The
set-last-read-generation
task sets the last-read
generation for a given client ID. This task is the counterpart of
clean-last-read-generation
.
As a result, you are setting the state for that client. This task is mainly used to save the last-read generation for use by a future delta read.
The syntax for this task is:
recordstore-cmd set-last-read-generation -a RecordStoreInstanceName -g GenId -c ClientId [-h HostName] [-l true|false] [-p PortNumber] [-x Id]
where:
-a (or --instanceName) specifies the name of a Record Store instance. Required.
-g (or --generation) specifies the generation ID to set as the last read for the client. Required.
-c (or --client) specifies a string for which the last-read generation will be set. You can use any string for the client ID, as it is used only as an identifier. Required.
-h (or --host) specifies the host where the CAS Service is running. If the flag is omitted, the default is the value of the
com.endeca.itl.cas.server.host
property incommandline.properties
. If the property is not set, the value then defaults to localhost. Optional.-l (or --isPortSsl) specifies whether to communicate with the service using an HTTPS connection. A value of true uses HTTPS and treats the
com.endeca.itl.cas.server.port
property as an SSL port. A value of false uses HTTP and treatscom.endeca.itl.cas.server.port
as a non-SSL port. Specify false if you enabled redirects from a non-SSL port to an SSL port. Optional.-p (or --port) specifies the port of the CAS Service. If the flag is omitted, the default is the value of the
com.endeca.itl.cas.server.port
property incommandline.properties
. If the property is not set, the value then defaults to 8500. Optional.-x (or --transaction) specifies the active transaction ID to use. If you use this option, you must follow it with a
commit-transaction
task to commit the read operation. If this flag is omitted, the operation is done in auto-commit mode. Optional.
Typically, you use this command so that the Record Store instance can save the state. For example, if you do a baseline-read of Generation 2, you might later come back to the Record Store instance and do a delta read of your last-read generation (in this case it is Generation 2) and the most recently-committed generation. So you would save the first baseline-read of Generation 2 for the client, for example, forge1, and then perform a delta read later after getting the last-read generation.
Example 39. Example of setting the last-read generation
This example sets Generation 2 as the last read for the client ID of forge1:
recordstore-cmd set-last-read-generation -a RS1 -c forge1 -g 2
If the command succeeds, it prints out this message:
Set the last read generation id for client forge1 to 2.
By using this method, Forge does not need to maintain state in order to use the Record Store; instead, it can push to the Record Store instance to maintain the state.