Call the startDeltaRead() method to create a
cursor for a delta (incremental) read to be consumed by the readRecords() method.
To run a delta read:
Create a connection to a Record Store server by calling the
create()method:RecordStoreLocator locator = RecordStoreLocator.create(host, port, instanceName);
Create a Record Store instance by calling the
getService()method:RecordStore recordStore = locator.getService();
Start a
READtransaction by calling thestartTransaction()method:TransactionId transactionId = recordStore.startTransaction(TransactionType.READ);
Create a
ReadCursorIdobject by calling thestartDeltaRead()method:ReadCursorId readCursorId = recordStore.startDeltaRead(transactionId, startGeneration, endGeneration);
Loop over the records returned by
readRecords()until all records from the read cursor are read:List<Record> records; do { records = recordStore.readRecords(readCursorId, numRecordsPerFetch); // do something with the records } while (!records.isEmpty());End the
READtransaction by calling theendRead()method:recordStore.endRead(readCursorId);
Commit the transaction by calling the
commitTransaction()method:recordStore.commitTransaction(transactionId);
Example 3. Example of running a delta read
RecordStoreLocator locator = RecordStoreLocator.create(host, port, instanceName);
RecordStore recordStore = locator.getService();
TransactionId transactionId = recordStore.startTransaction(TransactionType.READ);
ReadCursorId readCursorId = recordStore.startDeltaRead(transactionId, startGeneration, endGeneration);
List<Record> records;
do {
records = recordStore.readRecords(readCursorId, numRecordsPerFetch);
// do something with the records
} while (!records.isEmpty());
recordStore.endRead(readCursorId);
recordStore.commitTransaction(transactionId);

