|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RecordStore
Main interface for interacting with a Record Store instance.
Method Summary | |
---|---|
void |
clean()
Cleans records from the Record Store that are not in use by a read operation, that are not part of a generation that has been marked as "last read" by a client, and are beyond the generation retention time. |
void |
commitTransaction(TransactionId transactionId)
Commits all changes made by the given transaction. |
void |
endRead(ReadCursorId readCursorId)
Frees up any resources held by the given read cursor. |
RecordStoreConfiguration |
getConfiguration(Boolean isNormalized)
Returns the configuration of the Record Store. |
GenerationId |
getLastCommittedGenerationId(TransactionId transactionId)
Returns the id of the last committed generation visible to the given transaction. |
GenerationId |
getLastReadGenerationId(TransactionId transactionId,
ClientId clientId)
Returns the id of the generation last read by the given client. |
GenerationId |
getWriteGenerationId(TransactionId transactionId)
Returns the id of the generation the given READ_WRITE transaction is writing. |
List<TransactionInfo> |
listActiveTransactions()
Returns information about all active transactions. |
List<ClientStateInfo> |
listClientStates(TransactionId transactionId)
Returns the read states of all clients including the client id and last read generation. |
List<GenerationInfo> |
listGenerations()
Returns a list of generations currently stored in the Record Store. |
List<Record> |
readRecords(ReadCursorId readCursorId,
Integer numRecords)
Reads a specified number of records from the read cursor and advances the position of the cursor in the result set. |
List<Record> |
readRecordsById(TransactionId transactionId,
GenerationId generationId,
List<RecordId> recordIds)
Reads a set of Records corresponding to the given ids in the given generation. |
void |
rollbackTransaction(TransactionId transactionId)
Rolls back the given transaction. |
ConfigurationWarnings |
setConfiguration(RecordStoreConfiguration config)
Sets the configuration of the Record Store and returns any warning from setting the configuration. |
void |
setLastReadGenerationId(TransactionId transactionId,
ClientId clientId,
GenerationId generationId)
Sets the last read generation for the given client. |
ReadCursorId |
startBaselineRead(TransactionId transactionId,
GenerationId generationId)
Starts a baseline read of the given generation. |
ReadCursorId |
startDeltaRead(TransactionId transactionId,
GenerationId startGenerationId,
GenerationId endGenerationId)
Starts a read of the changes between the given generations. |
TransactionId |
startTransaction(TransactionType transactionType)
Starts a transaction of the given type and returns its id. |
int |
writeRecords(TransactionId transactionId,
List<Record> records)
Writes a batch of records to the Record Store in the scope of the given transaction. |
Method Detail |
---|
GenerationId getLastReadGenerationId(TransactionId transactionId, ClientId clientId) throws RecordStoreException, TransactionStateException, ConcurrentClientStateModificationException, TransactionNotFoundException
transactionId
- the id of the transactionclientId
- the id of the client
RecordStoreException
- if there is unexpected error while performing this method.
TransactionStateException
- if the specified transactionId refers to a transaction that
is no longer active.
TransactionNotFoundException
- if a transaction corresponding to the specified transactionId
does not exist.
ConcurrentClientStateModificationException
- if the last read generation of the given client has been
modified by a more recent transactionvoid setLastReadGenerationId(TransactionId transactionId, ClientId clientId, GenerationId generationId) throws RecordStoreException, TransactionStateException, ConcurrentClientStateModificationException, TransactionNotFoundException, InvalidGenerationException
transactionId
- the id of the transactionclientId
- the id of the clientgenerationId
- the id of the generation last read by the given client or null to clear the last
read generation for the given client
RecordStoreException
- if there is unexpected error while performing this method.
TransactionStateException
- if the specified transactionId refers to a transaction that
is no longer active
ConcurrentClientStateModificationException
- if the last read generation of the given client has been
modified by a more recent transaction
TransactionNotFoundException
- if a transaction corresponding to the specified transactionId
does not exist.
InvalidGenerationException
- if the specified generationId refers to a generation that has
been cleaned or never existed.@ResponseWrapper(className="com.endeca.itl.recordstore.ListClientStatesResponse") List<ClientStateInfo> listClientStates(TransactionId transactionId) throws RecordStoreException, TransactionNotFoundException, TransactionStateException
transactionId
- the id of the transaction
RecordStoreException
- if there is unexpected error while performing this method.
TransactionStateException
- if the specified transactionId refers to a transaction that
is no longer active.
TransactionNotFoundException
- if a transaction corresponding to the specified transactionId
does not exist.@ResponseWrapper(className="com.endeca.itl.recordstore.ListGenerationsResponse") List<GenerationInfo> listGenerations() throws RecordStoreException
RecordStoreException
- if there is unexpected error while performing this method.ReadCursorId startBaselineRead(TransactionId transactionId, GenerationId generationId) throws RecordStoreException, TransactionStateException, TransactionNotFoundException, InvalidGenerationException
transactionId
- the id of the transactiongenerationId
- the id of the generation to read from. A null value defaults
to the last committed generation visible to the transaction.
RecordStoreException
- if there is unexpected error while performing this method.
TransactionStateException
- if the specified transactionId refers to a transaction that
is no longer active.
TransactionNotFoundException
- if a transaction corresponding to the specified transactionId
does not exist.
InvalidGenerationException
- if the specified generationId refers to a generation that has
been cleaned or never existed.ReadCursorId startDeltaRead(TransactionId transactionId, GenerationId startGenerationId, GenerationId endGenerationId) throws RecordStoreException, TransactionStateException, TransactionNotFoundException, InvalidGenerationException
transactionId
- the id of the transactionstartGenerationId
- specifies the first generation to consider in the delta read.
A null value defaults to the initial empty generation and is
equivalent to performing a baseline read of the
endGenerationId.endGenerationId
- specifies the last generation to consider in the delta read. A
null value defaults to the last committed. generation visible
to the transaction
RecordStoreException
- if there is unexpected error while performing this method.
TransactionStateException
- if the specified transactionId refers to a transaction that
is no longer active.
TransactionNotFoundException
- if a transaction corresponding to the specified transactionId
does not exist.
InvalidGenerationException
- if the specified startGenerationId or endGenerationId refers
to a generation that has been cleaned or never existed.@ResponseWrapper(className="com.endeca.itl.recordstore.ReadRecordsResponse") List<Record> readRecords(ReadCursorId readCursorId, Integer numRecords) throws RecordStoreException, TransactionStateException, ReadCursorNotFoundException, TransactionNotFoundException
readCursorId
- the ReadCursorId returned by either a startBaselineRead() or
startDeltaRead() methodnumRecords
- the number of records to read from the read cursor. The call
will return fewer records if a fewer number of records remain
in the read cursor.
RecordStoreException
- if there is unexpected error while performing this method.
TransactionStateException
- if the read cursor is owned by a transaction that is no
longer active.
ReadCursorNotFoundException
- if the read cursor specified by readCursorId does not exist or
has already been closed.
TransactionNotFoundException
- if the reader cursor is owned by a transaction that no longer
exists.void endRead(ReadCursorId readCursorId) throws RecordStoreException, TransactionStateException, ReadCursorNotFoundException, TransactionNotFoundException
readCursorId
- the ReadCursorId returned by either a startBaselineRead() or
startDeltaRead() method
RecordStoreException
- if there is unexpected error while performing this method.
TransactionStateException
- if the read cursor is owned by a transaction that is no
longer active.
ReadCursorNotFoundException
- the read cursor specified by readCursorId does not exist or
has already been closed.
TransactionNotFoundException
- if the reader cursor is owned by a transaction that no longer
exists.@ResponseWrapper(className="com.endeca.itl.recordstore.ReadRecordsByIdResponse") List<Record> readRecordsById(TransactionId transactionId, GenerationId generationId, List<RecordId> recordIds) throws RecordStoreException, TransactionStateException, TransactionNotFoundException, InvalidGenerationException
transactionId
- the id of the transactiongenerationId
- the id of the generation to read from. A null value defaults
to the last committed generation visible to the transaction.recordIds
- the ids of the records to read
RecordStoreException
- if there is unexpected error while performing this method.
TransactionStateException
- if the specified transactionId refers to a transaction that
is no longer active.
TransactionNotFoundException
- if a transaction corresponding to the specified transactionId
does not exist.
InvalidGenerationException
- if the specified generationId refers to a generation that has
been cleaned or never existed.int writeRecords(TransactionId transactionId, List<Record> records) throws RecordStoreException, TransactionStateException, TransactionNotFoundException, InvalidRecordException, WriteNotAllowedException
transactionId
- the id of the transactionrecords
- the records to write
RecordStoreException
- if there is unexpected error while performing this method.
TransactionStateException
- if the specified transactionId refers to a transaction that
is no longer active.
TransactionNotFoundException
- if a transaction corresponding to the specified transactionId
does not exist.
InvalidRecordException
- if a record has an invalid value for Endeca.Action or if the
record has an Endeca.Action of UPSERT but no id property.
This exception will not be thrown if the Record Store is
configured to ignore invalid records.
WriteNotAllowedException
- if the specified transaction is not a READ_WRITE transactionGenerationId getLastCommittedGenerationId(TransactionId transactionId) throws RecordStoreException, TransactionStateException, TransactionNotFoundException
transactionId
- the id of the transaction
RecordStoreException
- if there is unexpected error while performing this method.
TransactionStateException
- if the specified transactionId refers to a transaction that
is no longer active.
TransactionNotFoundException
- if a transaction corresponding to the specified transactionId
does not exist.GenerationId getWriteGenerationId(TransactionId transactionId) throws RecordStoreException, TransactionStateException, TransactionNotFoundException, WriteNotAllowedException
transactionId
- the id of the READ_WRITE transaction
RecordStoreException
- if there is unexpected error while performing this method.
TransactionStateException
- if the specified transactionId refers to a transaction that
is no longer active.
TransactionNotFoundException
- if a transaction corresponding to the specified transactionId
does not exist.
WriteNotAllowedException
- if the specified transaction is not a READ_WRITE transactionTransactionId startTransaction(TransactionType transactionType) throws RecordStoreException, ConcurrentWriteException
transactionType
-
RecordStoreException
- if there is unexpected error while performing this method.
ConcurrentWriteException
- if starting a READ_WRITE transaction and there is already an
active READ_WRITE transactionvoid commitTransaction(TransactionId transactionId) throws RecordStoreException, TransactionStateException, TransactionNotFoundException
transactionId
- the id of the transaction to commit
RecordStoreException
- if there is unexpected error while performing this method.
TransactionStateException
- if the specified transactionId refers to a transaction that
is no longer active.
TransactionNotFoundException
- if a transaction corresponding to the specified transactionId
does not exist.void rollbackTransaction(TransactionId transactionId) throws RecordStoreException, TransactionStateException, TransactionNotFoundException
transactionId
- the id of the transaction to rollback
RecordStoreException
- if there is unexpected error while performing this method.
TransactionStateException
- if the specified transactionId refers to a transaction that
is no longer active.
TransactionNotFoundException
- if a transaction corresponding to the specified transactionId
does not exist.@ResponseWrapper(className="com.endeca.itl.recordstore.ListActiveTransactionsResponse") List<TransactionInfo> listActiveTransactions() throws RecordStoreException
RecordStoreException
- if there is unexpected error while performing this method.ConfigurationWarnings setConfiguration(RecordStoreConfiguration config) throws RecordStoreException, RecordStoreConfigurationException
config
- the configuration of the Record Store
RecordStoreException
- if there is unexpected error while performing this method.
RecordStoreConfigurationException
- if the configuration is invalidRecordStoreConfiguration getConfiguration(Boolean isNormalized)
isNormalized
- if true, the returned configuration will have defaults filled
in and relative paths converted to absolute paths. A null
value defaults to false.
void clean() throws RecordStoreException
RecordStoreException
- if there is unexpected error while performing this method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |