The read-delta
task reads the delta between two or more generations in the Record Store.
Delta records can be one of three types:
Modified records. A modified record has the same record ID as the previous version, but the content (as determined from the
changePropertyNames
property) has changed.Added records. An added (new) record will have a record ID that does not appear in the previous generations.
Deleted records. A deleted record will have a valid record ID, but its Endeca.Action property will be set to DELETE.
The syntax for this task is:
recordstore-cmd read-delta -a RecordStoreInstanceName [-c] [-f FileName] [-n NumRecs] [-h HostName] [-l true|false] [-p PortNumber] [-s StartGenId] [-e EndGenId] [-x Id]
where:
-a (or --instanceName) specifies the name of a Record Store instance. Required.
-c (or --count) prints the record count from the read. Optional.
-f (or --file) specifies the pathname of the file to which the Endeca records will be output. The filename extension will determine the format of the output file. Valid extensions for the file are
.xml
(for an XML format) and.bin
(for a binary format); the file can also have an additional, optional.gz
extension if it is a compressed file. Optional.-n (or --firstN) specifies that only the first numRecs number of delta records will be read. If omitted, all records are read. Optional.
-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.-s (or --startGeneration) specifies the ID of the start generation from which the diff will be done. If omitted, the initial generation is used. Optional.
-e (or --endGeneration) specifies the ID of the end generation from which the diff will be done. If omitted, the last-committed generation is used. 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.
For this task, it is recommended that you explicitly specify the start and end generations.
Example 27. Example of reading delta records
This example reads all the delta records that constitute the difference between Generation 1 and Generation 2 and writes them to a file:
recordstore-cmd read-delta -a RS1 -f c:\recdata\diffdata.xml -s 1 -e 2
The delta records are written in an XML format to the diffdata.xml
file located in the C:\recdata
directory.
If you only want a record count of the difference, use the -c option:
recordstore-cmd read-delta -a RS1 -c -s 1 -e 2
The number of delta records read is output to the console.