M
- type used to represent stored records@API(value=MAINTAINED) public interface FDBRecordStoreBase<M extends Message> extends RecordMetaDataProvider
Subspace
(often specified via a KeySpacePath
)RecordMetaData
associated with the data stored with the data in that subspaceFDBRecordContext
which wraps a FoundationDB Transaction
All of the record store's data—including index data—are stored durably within the given subspace. Note that
the meta-data is not stored by the record store directly. However, information about the store's current meta-data
version is persisted with the store to detect when the meta-data have changed and to know if any action needs to be taken
to begin using the new meta-data. (For example, new indexes might need to be built and removed indexes deleted.) The same
meta-data may be used for multiple record stores, and separating the meta-data from the data makes updating the shared
meta-data simpler as it only needs to be updated in one place. The FDBMetaDataStore
may be used if one wishes
to persist the meta-data into a FoundationDB cluster.
All operations conducted by a record store are conducted within the lifetime single transaction, and no data is persisted
to the database until the transaction is committed by calling FDBRecordContext.commit()
or
FDBRecordContext.commitAsync()
. Record Layer transactions inherit all of the guarantees and limitations of
the transactions exposed by FoundationDB, including their durability and consistency guarantees as well as size and
duration limits. See the FoundationDB known limitations
for more details.
The record store also allows the user to tweak additional parameters such as what the parallelism of pipelined operations
should be (through the FDBRecordStoreBase.PipelineSizer
) and what serializer should be used to read and write data to the database.
See the FDBRecordStoreBase.BaseBuilder
interface for more details.
FDBRecordStore
,
FDBTypedRecordStore
Modifier and Type | Interface and Description |
---|---|
static interface |
FDBRecordStoreBase.BaseBuilder<M extends Message,R extends FDBRecordStoreBase<M>>
Builder for
FDBRecordStoreBase . |
static interface |
FDBRecordStoreBase.PipelineSizer
Function for computing the number of elements to allow in the asynchronous pipeline for an operation of the given
type.
|
static class |
FDBRecordStoreBase.RecordExistenceCheck
Action to take if the record being saved does / does not already exist.
|
static class |
FDBRecordStoreBase.StoreExistenceCheck
Action to take if the record store does / does not already exist.
|
static interface |
FDBRecordStoreBase.UserVersionChecker
Hook for checking if store state for client changes.
|
static class |
FDBRecordStoreBase.VersionstampSaveBehavior
Provided during record save (via
saveRecord(Message, FDBRecordVersion, VersionstampSaveBehavior) ),
directs the behavior of the save w.r.t. |
Modifier and Type | Method and Description |
---|---|
default CompletableFuture<Integer> |
countRecords(Tuple low,
Tuple high,
EndpointType lowEndpoint,
EndpointType highEndpoint)
Count the number of records in the database in a range.
|
CompletableFuture<Integer> |
countRecords(Tuple low,
Tuple high,
EndpointType lowEndpoint,
EndpointType highEndpoint,
byte[] continuation,
ScanProperties scanProperties)
Count the number of records in the database in a range.
|
default FDBQueriedRecord<M> |
coveredIndexQueriedRecord(Index index,
IndexEntry indexEntry,
RecordType recordType,
M partialRecord,
boolean hasPrimaryKey)
Get a query result from a covering index entry.
|
void |
deleteAllRecords()
Delete all the data in the record store.
|
default boolean |
deleteRecord(Tuple primaryKey)
Delete the record with the given primary key.
|
CompletableFuture<Boolean> |
deleteRecordAsync(Tuple primaryKey)
Async version of
deleteRecord(com.apple.foundationdb.tuple.Tuple) . |
default void |
deleteRecordsWhere(QueryComponent component)
Delete records and associated index entries matching a query filter.
|
default void |
deleteRecordsWhere(String recordType,
QueryComponent component)
Delete records and associated index entries matching a query filter.
|
CompletableFuture<Void> |
deleteRecordsWhereAsync(QueryComponent component)
|
default CompletableFuture<Void> |
deleteRecordsWhereAsync(String recordType,
QueryComponent component)
Async version of
deleteRecordsWhere(String, QueryComponent) . |
default CompletableFuture<Tuple> |
evaluateAggregateFunction(EvaluationContext evaluationContext,
List<String> recordTypeNames,
IndexAggregateFunction aggregateFunction,
TupleRange range,
IsolationLevel isolationLevel)
Evaluate an
IndexAggregateFunction against a range of the store. |
default CompletableFuture<Tuple> |
evaluateAggregateFunction(List<String> recordTypeNames,
IndexAggregateFunction aggregateFunction,
Key.Evaluated value,
IsolationLevel isolationLevel)
Evaluate an
IndexAggregateFunction against a group value. |
CompletableFuture<Tuple> |
evaluateAggregateFunction(List<String> recordTypeNames,
IndexAggregateFunction aggregateFunction,
TupleRange range,
IsolationLevel isolationLevel)
Evaluate an
IndexAggregateFunction against a range of the store. |
<T> CompletableFuture<T> |
evaluateIndexRecordFunction(EvaluationContext evaluationContext,
IndexRecordFunction<T> function,
FDBRecord<M> record)
Evaluate a
IndexRecordFunction against a record. |
default <T> CompletableFuture<T> |
evaluateRecordFunction(EvaluationContext evaluationContext,
RecordFunction<T> function,
FDBRecord<M> record)
Evaluate a
RecordFunction against a record. |
default <T> CompletableFuture<T> |
evaluateRecordFunction(RecordFunction<T> function,
FDBRecord<M> record)
Evaluate a
RecordFunction against a record. |
<T> CompletableFuture<T> |
evaluateStoreFunction(EvaluationContext evaluationContext,
StoreRecordFunction<T> function,
FDBRecord<M> record)
Evaluate a
StoreRecordFunction against a record. |
default <T> CompletableFuture<T> |
evaluateStoreFunction(StoreRecordFunction<T> function,
FDBRecord<M> record)
Evaluate a
StoreRecordFunction against a record. |
default RecordCursor<FDBQueriedRecord<M>> |
executeQuery(RecordQuery query)
Plan and execute a query.
|
default RecordCursor<FDBQueriedRecord<M>> |
executeQuery(RecordQuery query,
byte[] continuation,
ExecuteProperties executeProperties)
Plan and execute a query.
|
default RecordCursor<FDBQueriedRecord<M>> |
executeQuery(RecordQueryPlan query)
Execute a query.
|
default RecordCursor<FDBQueriedRecord<M>> |
executeQuery(RecordQueryPlan query,
byte[] continuation,
ExecuteProperties executeProperties)
Execute a query.
|
default RecordCursor<FDBIndexedRecord<M>> |
fetchIndexRecords(Index index,
RecordCursor<IndexEntry> indexCursor,
IndexOrphanBehavior orphanBehavior)
Deprecated.
|
default RecordCursor<FDBIndexedRecord<M>> |
fetchIndexRecords(Index index,
RecordCursor<IndexEntry> indexCursor,
IndexOrphanBehavior orphanBehavior,
ExecuteState executeState)
Deprecated.
|
default RecordCursor<FDBIndexedRecord<M>> |
fetchIndexRecords(RecordCursor<IndexEntry> indexCursor,
IndexOrphanBehavior orphanBehavior)
Given a cursor that iterates over entries in an index, attempts to fetch the associated records for those entries.
|
default RecordCursor<FDBIndexedRecord<M>> |
fetchIndexRecords(RecordCursor<IndexEntry> indexCursor,
IndexOrphanBehavior orphanBehavior,
ExecuteState executeState)
Given a cursor that iterates over entries in an index, attempts to fetch the associated records for those entries.
|
FDBRecordContext |
getContext()
Get the record context (transaction) to use for the record store.
|
default Executor |
getExecutor() |
default int |
getPipelineSize(PipelineOperation pipelineOperation)
Get the number of elements to allow in the asynchronous pipeline for an operation of the given type.
|
FDBRecordStoreBase.PipelineSizer |
getPipelineSizer()
Get the function for computing the number of elements to allow in the asynchronous pipeline for an operation of the given
type.
|
RecordSerializer<M> |
getSerializer()
Get the serializer used to convert records into byte arrays.
|
default CompletableFuture<Long> |
getSnapshotRecordCount()
Get the number of records in the record store.
|
CompletableFuture<Long> |
getSnapshotRecordCount(KeyExpression key,
Key.Evaluated value)
Get the number of records in a portion of the record store determined by a group key expression.
|
CompletableFuture<Long> |
getSnapshotRecordCountForRecordType(String recordTypeName)
Get the number of records in the record store of the given record type.
|
default CompletableFuture<Long> |
getSnapshotRecordUpdateCount() |
default CompletableFuture<Long> |
getSnapshotRecordUpdateCount(KeyExpression key,
Key.Evaluated value) |
SubspaceProvider |
getSubspaceProvider()
Get the subspace provider.
|
default FDBStoreTimer |
getTimer() |
default <N extends Message> |
getTypedRecordStore(RecordSerializer<N> serializer)
Get a typed record store using the given typed serializer.
|
FDBRecordStore |
getUntypedRecordStore()
Get the untyped record store associated with this possibly typed store.
|
default CompletableFuture<Boolean> |
hasIndexEntryRecord(IndexEntry entry,
IsolationLevel isolationLevel)
Determine if a given index entry points to a record.
|
default CompletableFuture<Boolean> |
hasIndexEntryRecord(Index index,
IndexEntry entry,
IsolationLevel isolationLevel)
Deprecated.
use
hasIndexEntryRecord(IndexEntry, IsolationLevel) instead |
static Tuple |
indexEntryKey(Index index,
Tuple valueKey,
Tuple primaryKey)
Return a tuple to be used as the key for an index entry for the given value and primary key.
|
static Tuple |
indexEntryPrimaryKey(Index index,
Tuple entry)
Deprecated.
use
Index.getEntryPrimaryKey(Tuple) instead |
default FDBStoredRecord<M> |
insertRecord(M record)
Save the given record and throw an exception if a record already exists with the same primary key.
|
default CompletableFuture<FDBStoredRecord<M>> |
insertRecordAsync(M record)
Save the given record and throw an exception if a record already exists with the same primary key.
|
default CompletableFuture<FDBIndexedRecord<M>> |
loadIndexEntryRecord(IndexEntry entry,
IndexOrphanBehavior orphanBehavior)
Using the given index entry, resolve the primary key and asynchronously return the referenced record.
|
default CompletableFuture<FDBIndexedRecord<M>> |
loadIndexEntryRecord(IndexEntry entry,
IndexOrphanBehavior orphanBehavior,
ExecuteState executeState)
Using the given index entry, resolve the primary key and asynchronously return the referenced record.
|
default CompletableFuture<FDBIndexedRecord<M>> |
loadIndexEntryRecord(Index index,
IndexEntry entry,
IndexOrphanBehavior orphanBehavior)
Deprecated.
|
default CompletableFuture<FDBIndexedRecord<M>> |
loadIndexEntryRecord(Index index,
IndexEntry entry,
IndexOrphanBehavior orphanBehavior,
ExecuteState executeState)
Deprecated.
|
default FDBStoredRecord<M> |
loadRecord(Tuple primaryKey)
Load the record with the given primary key.
|
default FDBStoredRecord<M> |
loadRecord(Tuple primaryKey,
boolean snapshot)
Load the record with the given primary key.
|
default CompletableFuture<FDBStoredRecord<M>> |
loadRecordAsync(Tuple primaryKey)
Asynchronously load a record.
|
default CompletableFuture<FDBStoredRecord<M>> |
loadRecordAsync(Tuple primaryKey,
boolean snapshot)
Asynchronously load a record.
|
CompletableFuture<FDBStoredRecord<M>> |
loadRecordInternal(Tuple primaryKey,
ExecuteState executeState,
boolean snapshot) |
RecordQueryPlan |
planQuery(RecordQuery query)
Plan a query.
|
CompletableFuture<Void> |
preloadRecordAsync(Tuple primaryKey)
Get record into FDB RYW cache.
|
default FDBQueriedRecord<M> |
queriedRecord(FDBIndexedRecord<M> indexedRecord)
Get a query result record from an indexed record.
|
default FDBQueriedRecord<M> |
queriedRecord(FDBStoredRecord<M> storedRecord)
Get a query result record from a stored record.
|
default boolean |
recordExists(Tuple primaryKey)
Check if a record exists in the record store with the given primary key.
|
default boolean |
recordExists(Tuple primaryKey,
IsolationLevel isolationLevel)
Check if a record exists in the record store with the given primary key.
|
default CompletableFuture<Boolean> |
recordExistsAsync(Tuple primaryKey)
Check if a record exists in the record store with the given primary key.
|
CompletableFuture<Boolean> |
recordExistsAsync(Tuple primaryKey,
IsolationLevel isolationLevel)
Check if a record exists in the record store with the given primary key.
|
default CompletableFuture<Void> |
resolveUniquenessViolation(Index index,
Key.Evaluated indexKey,
Tuple primaryKey)
Removes all of the records that have the given value set as their index index value (are thus causing
a uniqueness violation) except for the one that has the given primary key (if the key is not
null ). |
CompletableFuture<Void> |
resolveUniquenessViolation(Index index,
Tuple valueKey,
Tuple primaryKey)
Removes all of the records that have the given value set as their index value (and are thus causing a
uniqueness violation) except for the one that has the given primary key (if the key is not
null ). |
default FDBStoredRecord<M> |
saveRecord(M record)
Save the given record.
|
default FDBStoredRecord<M> |
saveRecord(M record,
FDBRecordStoreBase.RecordExistenceCheck existenceCheck)
Save the given record.
|
default FDBStoredRecord<M> |
saveRecord(M record,
FDBRecordStoreBase.RecordExistenceCheck existenceCheck,
FDBRecordVersion version,
FDBRecordStoreBase.VersionstampSaveBehavior behavior)
Save the given record with a specific version.
|
default FDBStoredRecord<M> |
saveRecord(M record,
FDBRecordVersion version)
Save the given record with a specific version.
|
default FDBStoredRecord<M> |
saveRecord(M record,
FDBRecordVersion version,
FDBRecordStoreBase.VersionstampSaveBehavior behavior)
Save the given record with a specific version.
|
default CompletableFuture<FDBStoredRecord<M>> |
saveRecordAsync(M record)
Async version of
saveRecord(Message) . |
default CompletableFuture<FDBStoredRecord<M>> |
saveRecordAsync(M record,
FDBRecordStoreBase.RecordExistenceCheck existenceCheck)
Async version of
saveRecord(Message, RecordExistenceCheck) . |
CompletableFuture<FDBStoredRecord<M>> |
saveRecordAsync(M record,
FDBRecordStoreBase.RecordExistenceCheck existenceCheck,
FDBRecordVersion version,
FDBRecordStoreBase.VersionstampSaveBehavior behavior)
|
default CompletableFuture<FDBStoredRecord<M>> |
saveRecordAsync(M record,
FDBRecordVersion version)
Async version of
saveRecord(Message, FDBRecordVersion) . |
default CompletableFuture<FDBStoredRecord<M>> |
saveRecordAsync(M record,
FDBRecordVersion version,
FDBRecordStoreBase.VersionstampSaveBehavior behavior)
Async version of
saveRecord(Message, FDBRecordVersion, VersionstampSaveBehavior) . |
RecordCursor<IndexEntry> |
scanIndex(Index index,
IndexScanType scanType,
TupleRange range,
byte[] continuation,
ScanProperties scanProperties)
Scan the entries in an index.
|
default RecordCursor<IndexEntry> |
scanIndex(Index index,
IndexScanType scanType,
TupleRange range,
byte[] continuation,
ScanProperties scanProperties,
RecordScanLimiter recordScanLimiter)
Deprecated.
because the
RecordScanLimiter should be specified as part of the ScanProperties instead |
default RecordCursor<FDBIndexedRecord<M>> |
scanIndexRecords(String indexName)
Scan the records pointed to by an index.
|
default RecordCursor<FDBIndexedRecord<M>> |
scanIndexRecords(String indexName,
IndexScanType scanType,
TupleRange range,
byte[] continuation,
IndexOrphanBehavior orphanBehavior,
ScanProperties scanProperties)
Scan the records pointed to by an index.
|
default RecordCursor<FDBIndexedRecord<M>> |
scanIndexRecords(String indexName,
IndexScanType scanType,
TupleRange range,
byte[] continuation,
IndexOrphanBehavior orphanBehavior,
ScanProperties scanProperties,
RecordScanLimiter recordScanLimiter)
Deprecated.
because the
RecordScanLimiter should be specified as part of the ScanProperties instead |
default RecordCursor<FDBIndexedRecord<M>> |
scanIndexRecords(String indexName,
IndexScanType scanType,
TupleRange range,
byte[] continuation,
ScanProperties scanProperties)
Scan the records pointed to by an index.
|
default RecordCursor<FDBIndexedRecord<M>> |
scanIndexRecords(String indexName,
IndexScanType scanType,
TupleRange range,
byte[] continuation,
ScanProperties scanProperties,
RecordScanLimiter recordScanLimiter)
Deprecated.
because the
RecordScanLimiter should be specified as part of the ScanProperties instead |
default RecordCursor<FDBIndexedRecord<M>> |
scanIndexRecords(String indexName,
IsolationLevel isolationLevel)
Scan the records pointed to by an index.
|
default RecordCursor<FDBIndexedRecord<M>> |
scanIndexRecordsBetween(String indexName,
Object low,
Object high)
Scan the records pointed to by an index between two indexed values.
|
default RecordCursor<FDBIndexedRecord<M>> |
scanIndexRecordsEqual(String indexName,
Object... values)
Scan the records pointed to by an index equal to indexed values.
|
default RecordCursor<FDBStoredRecord<M>> |
scanRecords(byte[] continuation,
ScanProperties scanProperties)
Scan the records in the database.
|
default RecordCursor<FDBStoredRecord<M>> |
scanRecords(TupleRange range,
byte[] continuation,
ScanProperties scanProperties)
Scan the records in the database in a range.
|
RecordCursor<FDBStoredRecord<M>> |
scanRecords(Tuple low,
Tuple high,
EndpointType lowEndpoint,
EndpointType highEndpoint,
byte[] continuation,
ScanProperties scanProperties)
Scan the records in the database in a range.
|
default RecordCursor<RecordIndexUniquenessViolation> |
scanUniquenessViolations(Index index)
Scan the list of uniqueness violations for an index for violations with a specific value.
|
default RecordCursor<RecordIndexUniquenessViolation> |
scanUniquenessViolations(Index index,
byte[] continuation,
ScanProperties scanProperties)
Scan the list of uniqueness violations for an index for violations with a specific value.
|
default RecordCursor<RecordIndexUniquenessViolation> |
scanUniquenessViolations(Index index,
int limit)
Scan the list of uniqueness violations for an index for violations with a specific value.
|
default RecordCursor<RecordIndexUniquenessViolation> |
scanUniquenessViolations(Index index,
Key.Evaluated indexKey)
Scan the list of uniqueness violations for an index for violations with a specific value.
|
default RecordCursor<RecordIndexUniquenessViolation> |
scanUniquenessViolations(Index index,
Key.Evaluated indexKey,
byte[] continuation,
ScanProperties scanProperties)
Scan the list of uniqueness violations for an index for violations with a specific value.
|
default RecordCursor<RecordIndexUniquenessViolation> |
scanUniquenessViolations(Index index,
Tuple valueKey)
Scan the list of uniqueness violations for an index for violations with a specific value.
|
default RecordCursor<RecordIndexUniquenessViolation> |
scanUniquenessViolations(Index index,
Tuple valueKey,
byte[] continuation,
ScanProperties scanProperties)
Scan the list of uniqueness violations for an index for violations with a specific value.
|
RecordCursor<RecordIndexUniquenessViolation> |
scanUniquenessViolations(Index index,
TupleRange range,
byte[] continuation,
ScanProperties scanProperties)
Scan the list of uniqueness violations identified for an index.
|
static Tuple |
uniquenessViolationKey(Tuple valueKey,
Tuple primaryKey)
Return the key portion of
entry , which should be the key with the index value
as a tuple. |
default FDBStoredRecord<M> |
updateRecord(M record)
Save the given record and throw an exception if the record does not already exist in the database.
|
default CompletableFuture<FDBStoredRecord<M>> |
updateRecordAsync(M record)
Save the given record and throw an exception if the record does not already exist in the database.
|
getRecordMetaData
FDBRecordStore getUntypedRecordStore()
default <N extends Message> FDBTypedRecordStore<N> getTypedRecordStore(@Nonnull RecordSerializer<N> serializer)
N
- the type for the new record storeserializer
- typed serializer to use@Nonnull FDBRecordContext getContext()
@Nullable default FDBStoreTimer getTimer()
@Nullable SubspaceProvider getSubspaceProvider()
@Nonnull RecordSerializer<M> getSerializer()
@Nonnull default CompletableFuture<FDBStoredRecord<M>> saveRecordAsync(@Nonnull M record)
saveRecord(Message)
.record
- the record to save@Nonnull default CompletableFuture<FDBStoredRecord<M>> saveRecordAsync(@Nonnull M record, @Nonnull FDBRecordStoreBase.RecordExistenceCheck existenceCheck)
saveRecord(Message, RecordExistenceCheck)
.record
- the record to saveexistenceCheck
- when to throw an exception if a record with the same primary key does or does not already exist@Nonnull default CompletableFuture<FDBStoredRecord<M>> saveRecordAsync(@Nonnull M record, @Nullable FDBRecordVersion version)
saveRecord(Message, FDBRecordVersion)
.record
- the record to saveversion
- the associated record version@Nonnull default CompletableFuture<FDBStoredRecord<M>> saveRecordAsync(@Nonnull M record, @Nullable FDBRecordVersion version, @Nonnull FDBRecordStoreBase.VersionstampSaveBehavior behavior)
saveRecord(Message, FDBRecordVersion, VersionstampSaveBehavior)
.record
- the record to saveversion
- the associated record versionbehavior
- the save behavior w.r.t. the given version
@Nonnull CompletableFuture<FDBStoredRecord<M>> saveRecordAsync(@Nonnull M record, @Nonnull FDBRecordStoreBase.RecordExistenceCheck existenceCheck, @Nullable FDBRecordVersion version, @Nonnull FDBRecordStoreBase.VersionstampSaveBehavior behavior)
saveRecord(Message, RecordExistenceCheck, FDBRecordVersion, VersionstampSaveBehavior)
.record
- the record to saveexistenceCheck
- when to throw an exception if a record with the same primary key does or does not already existversion
- the associated record versionbehavior
- the save behavior w.r.t. the given version
@Nonnull default FDBStoredRecord<M> saveRecord(@Nonnull M record)
record
- the record to be saved@Nonnull default FDBStoredRecord<M> saveRecord(@Nonnull M record, @Nonnull FDBRecordStoreBase.RecordExistenceCheck existenceCheck)
record
- the record to be savedexistenceCheck
- when to throw an exception if a record with the same primary key does or does not already exist@Nonnull default FDBStoredRecord<M> saveRecord(@Nonnull M record, @Nullable FDBRecordVersion version)
null
is passed for version
, then a new version is
created that will be unique for this record.record
- the record to be savedversion
- the version to associate with the record when saving@Nonnull default FDBStoredRecord<M> saveRecord(@Nonnull M record, @Nullable FDBRecordVersion version, @Nonnull FDBRecordStoreBase.VersionstampSaveBehavior behavior)
DEFAULT
then
the method acts as saveRecord(Message, FDBRecordVersion)
. If behavior is NO_VERSION
then
version
is ignored and no version is saved. If behavior is WITH_VERSION
then the value
of version
is stored as given by the caller.record
- the record to be savedversion
- the version to associate with the record when savingbehavior
- the save behavior w.r.t. the given version
@Nonnull default FDBStoredRecord<M> saveRecord(@Nonnull M record, @Nonnull FDBRecordStoreBase.RecordExistenceCheck existenceCheck, @Nullable FDBRecordVersion version, @Nonnull FDBRecordStoreBase.VersionstampSaveBehavior behavior)
DEFAULT
then
the method acts as saveRecord(Message, FDBRecordVersion)
. If behavior is NO_VERSION
then
version
is ignored and no version is saved. If behavior is WITH_VERSION
then the value
of version
is stored as given by the caller.record
- the record to be savedexistenceCheck
- when to throw an exception if a record with the same primary key does or does not already existversion
- the version to associate with the record when savingbehavior
- the save behavior w.r.t. the given version
@Nonnull default CompletableFuture<FDBStoredRecord<M>> insertRecordAsync(@Nonnull M record)
record
- the record to be saved@Nonnull default FDBStoredRecord<M> insertRecord(@Nonnull M record)
record
- the record to be saved@Nonnull default CompletableFuture<FDBStoredRecord<M>> updateRecordAsync(@Nonnull M record)
record
- the record to be saved@Nonnull default FDBStoredRecord<M> updateRecord(@Nonnull M record)
record
- the record to be saved@Nullable default FDBStoredRecord<M> loadRecord(@Nonnull Tuple primaryKey)
primaryKey
- the primary key for the recordFDBStoredRecord
for the record or null
.@Nullable default FDBStoredRecord<M> loadRecord(@Nonnull Tuple primaryKey, boolean snapshot)
primaryKey
- the primary key for the recordsnapshot
- whether to load at snapshot isolationFDBStoredRecord
for the record or null
.@Nonnull default CompletableFuture<FDBStoredRecord<M>> loadRecordAsync(@Nonnull Tuple primaryKey)
primaryKey
- the key for the record to be loaded@Nonnull default CompletableFuture<FDBStoredRecord<M>> loadRecordAsync(@Nonnull Tuple primaryKey, boolean snapshot)
primaryKey
- the key for the record to be loadedsnapshot
- whether to load at snapshot isolation@Nonnull @API(value=INTERNAL) CompletableFuture<FDBStoredRecord<M>> loadRecordInternal(@Nonnull Tuple primaryKey, @Nonnull ExecuteState executeState, boolean snapshot)
@Nonnull CompletableFuture<Void> preloadRecordAsync(@Nonnull Tuple primaryKey)
primaryKey
- the primary key for the record to retrieve@Nonnull default CompletableFuture<Boolean> recordExistsAsync(@Nonnull Tuple primaryKey)
IsolationLevel.SERIALIZABLE
isolation level.primaryKey
- the primary key of the recordtrue
if some record in record store has that primary key and
false
otherwiserecordExistsAsync(Tuple, IsolationLevel)
@Nonnull CompletableFuture<Boolean> recordExistsAsync(@Nonnull Tuple primaryKey, @Nonnull IsolationLevel isolationLevel)
null
as it does not have to deserialize the record, though the record's contents are still read from the
database and sent over the network.primaryKey
- the primary key of the recordisolationLevel
- the isolation level to use when readingtrue
if some record in record store has that primary key and
false
otherwisedefault boolean recordExists(@Nonnull Tuple primaryKey)
recordExistsAsync(Tuple)
.primaryKey
- the primary key of the recordtrue
if some record in record store has that primary key and false
otherwiserecordExistsAsync(Tuple)
default boolean recordExists(@Nonnull Tuple primaryKey, @Nonnull IsolationLevel isolationLevel)
recordExistsAsync(Tuple, IsolationLevel)
.primaryKey
- the primary key of the recordisolationLevel
- the isolation level to use when readingtrue
if some record in record store has that primary key and false
otherwiserecordExistsAsync(Tuple)
@Nonnull default RecordCursor<FDBStoredRecord<M>> scanRecords(@Nullable byte[] continuation, @Nonnull ScanProperties scanProperties)
continuation
- any continuation from a previous scanscanProperties
- skip, limit and other scan properties@Nonnull default RecordCursor<FDBStoredRecord<M>> scanRecords(@Nonnull TupleRange range, @Nullable byte[] continuation, @Nonnull ScanProperties scanProperties)
range
- the range to scancontinuation
- any continuation from a previous scanscanProperties
- skip, limit and other scan properties@Nonnull RecordCursor<FDBStoredRecord<M>> scanRecords(@Nullable Tuple low, @Nullable Tuple high, @Nonnull EndpointType lowEndpoint, @Nonnull EndpointType highEndpoint, @Nullable byte[] continuation, @Nonnull ScanProperties scanProperties)
low
- low point of scan rangehigh
- high point of scan pointlowEndpoint
- whether low point is inclusive or exclusivehighEndpoint
- whether high point is inclusive or exclusivecontinuation
- any continuation from a previous scanscanProperties
- skip, limit and other scan properties@Nonnull default CompletableFuture<Integer> countRecords(@Nullable Tuple low, @Nullable Tuple high, @Nonnull EndpointType lowEndpoint, @Nonnull EndpointType highEndpoint)
low
- low point of scan rangehigh
- high point of scan pointlowEndpoint
- whether low point is inclusive or exclusivehighEndpoint
- whether high point is inclusive or exclusive@Nonnull CompletableFuture<Integer> countRecords(@Nullable Tuple low, @Nullable Tuple high, @Nonnull EndpointType lowEndpoint, @Nonnull EndpointType highEndpoint, @Nullable byte[] continuation, @Nonnull ScanProperties scanProperties)
low
- low point of scan rangehigh
- high point of scan pointlowEndpoint
- whether low point is inclusive or exclusivehighEndpoint
- whether high point is inclusive or exclusivecontinuation
- any continuation from a previous scanscanProperties
- skip, limit and other scan properties@Nonnull RecordCursor<IndexEntry> scanIndex(@Nonnull Index index, @Nonnull IndexScanType scanType, @Nonnull TupleRange range, @Nullable byte[] continuation, @Nonnull ScanProperties scanProperties)
index
- the index to scanscanType
- the type of scan to performrange
- range to scancontinuation
- any continuation from a previous scanscanProperties
- skip, limit and other scan properties@API(value=DEPRECATED) @Deprecated @Nonnull default RecordCursor<IndexEntry> scanIndex(@Nonnull Index index, @Nonnull IndexScanType scanType, @Nonnull TupleRange range, @Nullable byte[] continuation, @Nonnull ScanProperties scanProperties, @Nullable RecordScanLimiter recordScanLimiter)
RecordScanLimiter
should be specified as part of the ScanProperties
insteadindex
- the index to scanscanType
- the type of scan to performrange
- range to scancontinuation
- any continuation from a previous scanscanProperties
- skip, limit and other scan propertiesrecordScanLimiter
- the scan limit to use@Nonnull default RecordCursor<FDBIndexedRecord<M>> scanIndexRecords(@Nonnull String indexName)
indexName
- the name of the index@Nonnull default RecordCursor<FDBIndexedRecord<M>> scanIndexRecords(@Nonnull String indexName, IsolationLevel isolationLevel)
indexName
- the name of the indexisolationLevel
- the isolation level to use when reading@Nonnull default RecordCursor<FDBIndexedRecord<M>> scanIndexRecords(@Nonnull String indexName, @Nonnull IndexScanType scanType, @Nonnull TupleRange range, @Nullable byte[] continuation, @Nonnull ScanProperties scanProperties)
indexName
- the name of the indexscanType
- the type of scan to performrange
- the range of the index to scancontinuation
- any continuation from a previous scanscanProperties
- skip, limit and other scan properties@API(value=DEPRECATED) @Deprecated @Nonnull default RecordCursor<FDBIndexedRecord<M>> scanIndexRecords(@Nonnull String indexName, @Nonnull IndexScanType scanType, @Nonnull TupleRange range, @Nullable byte[] continuation, @Nonnull ScanProperties scanProperties, @Nullable RecordScanLimiter recordScanLimiter)
RecordScanLimiter
should be specified as part of the ScanProperties
insteadindexName
- the name of the indexscanType
- the type of scan to performrange
- the range of the index to scancontinuation
- any continuation from a previous scanscanProperties
- skip, limit and other scan propertiesrecordScanLimiter
- the scan limit to use@Nonnull default RecordCursor<FDBIndexedRecord<M>> scanIndexRecords(@Nonnull String indexName, @Nonnull IndexScanType scanType, @Nonnull TupleRange range, @Nullable byte[] continuation, @Nonnull IndexOrphanBehavior orphanBehavior, @Nonnull ScanProperties scanProperties)
indexName
- the name of the indexscanType
- the type of scan to performrange
- the range of the index to scancontinuation
- any continuation from a previous scanorphanBehavior
- how the iteration process should respond in the face of entries in the index for which
there is no associated recordscanProperties
- skip, limit and other scan properties@API(value=DEPRECATED) @Deprecated @Nonnull default RecordCursor<FDBIndexedRecord<M>> scanIndexRecords(@Nonnull String indexName, @Nonnull IndexScanType scanType, @Nonnull TupleRange range, @Nullable byte[] continuation, @Nonnull IndexOrphanBehavior orphanBehavior, @Nonnull ScanProperties scanProperties, @Nullable RecordScanLimiter recordScanLimiter)
RecordScanLimiter
should be specified as part of the ScanProperties
insteadindexName
- the name of the indexscanType
- the type of scan to performrange
- the range of the index to scancontinuation
- any continuation from a previous scanorphanBehavior
- how the iteration process should respond in the face of entries in the index for which
there is no associated recordscanProperties
- skip, limit and other scan propertiesrecordScanLimiter
- the scan limit to use@API(value=DEPRECATED) @Deprecated @Nonnull default RecordCursor<FDBIndexedRecord<M>> fetchIndexRecords(@Nonnull Index index, @Nonnull RecordCursor<IndexEntry> indexCursor, @Nonnull IndexOrphanBehavior orphanBehavior)
fetchIndexRecords(RecordCursor, IndexOrphanBehavior)
insteadindex
- the definition of the index being scannedindexCursor
- a cursor iterating over entries in the indexorphanBehavior
- how the iteration process should respond in the face of entries in the index for which
there is no associated record@Nonnull default RecordCursor<FDBIndexedRecord<M>> fetchIndexRecords(@Nonnull RecordCursor<IndexEntry> indexCursor, @Nonnull IndexOrphanBehavior orphanBehavior)
indexCursor
- a cursor iterating over entries in the indexorphanBehavior
- how the iteration process should respond in the face of entries in the index for which
there is no associated record@API(value=DEPRECATED) @Deprecated @Nonnull default RecordCursor<FDBIndexedRecord<M>> fetchIndexRecords(@Nonnull Index index, @Nonnull RecordCursor<IndexEntry> indexCursor, @Nonnull IndexOrphanBehavior orphanBehavior, @Nonnull ExecuteState executeState)
fetchIndexRecords(RecordCursor, IndexOrphanBehavior, ExecuteState)
insteadindex
- the definition of the index being scannedindexCursor
- a cursor iterating over entries in the indexorphanBehavior
- how the iteration process should respond in the face of entries in the index for which
there is no associated recordexecuteState
- the ExecuteState
associated with this query execution@Nonnull default RecordCursor<FDBIndexedRecord<M>> fetchIndexRecords(@Nonnull RecordCursor<IndexEntry> indexCursor, @Nonnull IndexOrphanBehavior orphanBehavior, @Nonnull ExecuteState executeState)
indexCursor
- A cursor iterating over entries in the index.orphanBehavior
- How the iteration process should respond in the face of entries in the index for which
there is no associated record.executeState
- the ExecuteState
associated with this query execution@Nonnull default RecordCursor<FDBIndexedRecord<M>> scanIndexRecordsEqual(@Nonnull String indexName, @Nonnull Object... values)
indexName
- the name of the indexvalues
- a left-subset of values of indexed fields@Nonnull default RecordCursor<FDBIndexedRecord<M>> scanIndexRecordsBetween(@Nonnull String indexName, @Nullable Object low, @Nullable Object high)
indexName
- the name of the indexlow
- the low value for the first indexed fieldhigh
- the high value for the first indexed field@API(value=DEPRECATED) @Deprecated @Nonnull default CompletableFuture<Boolean> hasIndexEntryRecord(@Nonnull Index index, @Nonnull IndexEntry entry, @Nonnull IsolationLevel isolationLevel)
hasIndexEntryRecord(IndexEntry, IsolationLevel)
insteadindex
- the index to checkentry
- the index entry to checkisolationLevel
- whether to use snapshot readtrue
if the given index entry still points to a record@Nonnull default CompletableFuture<Boolean> hasIndexEntryRecord(@Nonnull IndexEntry entry, @Nonnull IsolationLevel isolationLevel)
entry
- the index entry to checkisolationLevel
- whether to use snapshot readtrue
if the given index entry still points to a record@API(value=DEPRECATED) @Deprecated @Nonnull default CompletableFuture<FDBIndexedRecord<M>> loadIndexEntryRecord(@Nonnull Index index, @Nonnull IndexEntry entry, @Nonnull IndexOrphanBehavior orphanBehavior)
loadIndexEntryRecord(IndexEntry, IndexOrphanBehavior)
insteadindex
- the index being scannedentry
- the index entry to be resolvedorphanBehavior
- the IndexOrphanBehavior
to apply if the record is not found@Nonnull default CompletableFuture<FDBIndexedRecord<M>> loadIndexEntryRecord(@Nonnull IndexEntry entry, @Nonnull IndexOrphanBehavior orphanBehavior)
entry
- the index entry to be resolvedorphanBehavior
- the IndexOrphanBehavior
to apply if the record is not found@API(value=DEPRECATED) @Deprecated @Nonnull default CompletableFuture<FDBIndexedRecord<M>> loadIndexEntryRecord(@Nonnull Index index, @Nonnull IndexEntry entry, @Nonnull IndexOrphanBehavior orphanBehavior, @Nonnull ExecuteState executeState)
loadIndexEntryRecord(IndexEntry, IndexOrphanBehavior, ExecuteState)
insteadindex
- the index being scannedentry
- the index entry to be resolvedorphanBehavior
- the IndexOrphanBehavior
to apply if the record is not foundexecuteState
- an execution state object to be used to enforce limits on query execution@Nonnull default CompletableFuture<FDBIndexedRecord<M>> loadIndexEntryRecord(@Nonnull IndexEntry entry, @Nonnull IndexOrphanBehavior orphanBehavior, @Nonnull ExecuteState executeState)
entry
- the index entry to be resolvedorphanBehavior
- the IndexOrphanBehavior
to apply if the record is not foundexecuteState
- an execution state object to be used to enforce limits on query execution@API(value=DEPRECATED) @Deprecated @Nonnull static Tuple indexEntryPrimaryKey(@Nonnull Index index, @Nonnull Tuple entry)
Index.getEntryPrimaryKey(Tuple)
insteadindex
- the index associated with this entryentry
- the index entry@Nonnull static Tuple indexEntryKey(@Nonnull Index index, @Nonnull Tuple valueKey, @Nonnull Tuple primaryKey)
index
- the index for which this will be an entryvalueKey
- the indexed value(s) for the entryprimaryKey
- the primary key for the record@Nonnull default RecordCursor<RecordIndexUniquenessViolation> scanUniquenessViolations(@Nonnull Index index, @Nonnull Tuple valueKey, @Nullable byte[] continuation, @Nonnull ScanProperties scanProperties)
scanUniquenessViolations()
that takes a TupleRange
, but this version only selects violations that have the
given key as the uniqueness violation key.index
- the index to scan the uniqueness violations ofvalueKey
- the key (as a tuple) of the index whose violations to scancontinuation
- any continuation from a previous scanscanProperties
- skip, limit and other scan properties@Nonnull default RecordCursor<RecordIndexUniquenessViolation> scanUniquenessViolations(@Nonnull Index index, @Nonnull Key.Evaluated indexKey, @Nullable byte[] continuation, @Nonnull ScanProperties scanProperties)
scanUniquenessViolations()
that takes a TupleRange
, but this version only selects violations that have the
given key as the uniqueness violation key.index
- the index to scan the uniqueness violations ofindexKey
- the key of the index whose violations to scancontinuation
- any continuation from a previous scanscanProperties
- skip, limit and other scan properties@Nonnull default RecordCursor<RecordIndexUniquenessViolation> scanUniquenessViolations(@Nonnull Index index, @Nonnull Tuple valueKey)
scanUniquenessViolations()
that takes a TupleRange
, but this version only selects violations that have the
given key as the uniqueness violation key. It does not limit the number of responses it returns.index
- the index to scan the uniqueness violations ofvalueKey
- the key (as a tuple) of the index whose violations to scan@Nonnull default RecordCursor<RecordIndexUniquenessViolation> scanUniquenessViolations(@Nonnull Index index, @Nonnull Key.Evaluated indexKey)
scanUniquenessViolations()
that takes a TupleRange
, but this version only selects violations that have the
given key as the uniqueness violation key. It does not limit the number of responses it
returns.index
- the index to scan the uniqueness violations ofindexKey
- the key of the index whose violations to scan@Nonnull default RecordCursor<RecordIndexUniquenessViolation> scanUniquenessViolations(@Nonnull Index index, @Nullable byte[] continuation, @Nonnull ScanProperties scanProperties)
scanUniquenessViolations()
that takes a TupleRange
, but this version tries to retrieve all of the violations it can
subject to the limit specified.index
- the index to scan the uniqueness violations ofcontinuation
- any continuation from a previous scanscanProperties
- skip, limit and other scan properties@Nonnull default RecordCursor<RecordIndexUniquenessViolation> scanUniquenessViolations(@Nonnull Index index, int limit)
scanUniquenessViolations()
that takes a TupleRange
, but this version tries to retrieve all of the violations it can
subject to the limit specified.index
- the index to scan the uniqueness violations oflimit
- the maximum number of uniqueness violations to report@Nonnull default RecordCursor<RecordIndexUniquenessViolation> scanUniquenessViolations(@Nonnull Index index)
scanUniquenessViolations()
that takes a TupleRange
, but this version tries to retrieve all of the violations it can. It
does not try to limit its results.index
- the index to scan the uniqueness violations of@Nonnull RecordCursor<RecordIndexUniquenessViolation> scanUniquenessViolations(@Nonnull Index index, @Nonnull TupleRange range, @Nullable byte[] continuation, @Nonnull ScanProperties scanProperties)
Because of how the data are stored, each primary key that is part of a uniqueness violation will appear at most once for each index key that is causing a violation. The associated existing key is going to be one of the other keys, but it might not be the only one. This means that the total number of violations per index key is capped at the number of records in the store (rather than the square), but it also means that the existing key data is of limited help.
index
- the index to scan the uniqueness violations ofrange
- the range of tuples to include in the scancontinuation
- any continuation from a previous scanscanProperties
- skip, limit and other scan properties@Nonnull default CompletableFuture<Void> resolveUniquenessViolation(@Nonnull Index index, @Nonnull Key.Evaluated indexKey, @Nullable Tuple primaryKey)
null
).
This is like the version of resolveUniquenessViolation()
that takes a Tuple
, but this takes the index value as a Key.Evaluated
instead.index
- the index to resolve uniqueness violations forindexKey
- the value of the index that is being removedprimaryKey
- the primary key of the record that should remain (or null
to remove all of them)@Nonnull CompletableFuture<Void> resolveUniquenessViolation(@Nonnull Index index, @Nonnull Tuple valueKey, @Nullable Tuple primaryKey)
null
).
It also cleans up the set of uniqueness violations so that none of the remaining entries will
be associated with the given value key.index
- the index to resolve uniqueness violations forvalueKey
- the value of the index that is being removedprimaryKey
- the primary key of the record that should remain (or null
to remove all of them)@Nonnull static Tuple uniquenessViolationKey(@Nonnull Tuple valueKey, @Nonnull Tuple primaryKey)
entry
, which should be the key with the index value
as a tuple. This is used to store the index uniqueness violations when building a
unique index.valueKey
- the value of the index for a recordprimaryKey
- the primary key for a record@Nonnull CompletableFuture<Boolean> deleteRecordAsync(@Nonnull Tuple primaryKey)
deleteRecord(com.apple.foundationdb.tuple.Tuple)
.primaryKey
- the primary key of the record to deletetrue
if the record was present to be deleteddefault boolean deleteRecord(@Nonnull Tuple primaryKey)
primaryKey
- the primary key for the record to be deletedvoid deleteAllRecords()
Everything except the store header and index state information is cleared from the database.
This is is an efficient operation as all data are contiguous.
This means that any disabled or write-only
index will remain in its disabled or write-only state after all of the data are cleared. If one also wants
to reset all index states, one can call FDBRecordStore.rebuildAllIndexes()
, which should complete
quickly on an empty record store. If one wants to remove the record store entirely (including the store
header and all index states), one should call FDBRecordStore.deleteStore(FDBRecordContext, KeySpacePath)
instead of this method.
@Nonnull default void deleteRecordsWhere(@Nonnull QueryComponent component)
Throws an exception if the operation cannot be done efficiently in a small number of contiguous range clears. In practice, this means that the query filter must constrain a prefix of all record types' primary keys and of all indexes' root expressions.
component
- the query filter for records to delete efficiently@Nonnull default void deleteRecordsWhere(@Nonnull String recordType, @Nullable QueryComponent component)
Throws an exception if the operation cannot be done efficiently in a small number of contiguous range clears. In practice, this means both that all record types must have a record type key prefix and that the query filter must constrain a prefix of all record types' primary keys and of all indexes' root expressions.
recordType
- the type of records to deletecomponent
- the query filter for records to delete efficiently or null
to delete all records of the given type@Nonnull CompletableFuture<Void> deleteRecordsWhereAsync(@Nonnull QueryComponent component)
deleteRecordsWhereAsync(com.apple.foundationdb.record.query.expressions.QueryComponent)
.component
- the query filter for records to delete efficiently@Nonnull default CompletableFuture<Void> deleteRecordsWhereAsync(@Nonnull String recordType, @Nullable QueryComponent component)
deleteRecordsWhere(String, QueryComponent)
.recordType
- the type of records to deletecomponent
- the query filter for records to delete efficiently or null
to delete all records of the given type@Nonnull FDBRecordStoreBase.PipelineSizer getPipelineSizer()
default int getPipelineSize(@Nonnull PipelineOperation pipelineOperation)
pipelineOperation
- the operation@Nonnull default CompletableFuture<Long> getSnapshotRecordCount()
COUNT
type index defined.@Nonnull CompletableFuture<Long> getSnapshotRecordCount(@Nonnull KeyExpression key, @Nonnull Key.Evaluated value)
COUNT
type index defined.key
- the grouping key expressionvalue
- the value of key
to match@Nonnull CompletableFuture<Long> getSnapshotRecordCountForRecordType(@Nonnull String recordTypeName)
COUNT
index defined for it.recordTypeName
- record type for which to count recordsdefault CompletableFuture<Long> getSnapshotRecordUpdateCount()
default CompletableFuture<Long> getSnapshotRecordUpdateCount(@Nonnull KeyExpression key, @Nonnull Key.Evaluated value)
@Nonnull default <T> CompletableFuture<T> evaluateRecordFunction(@Nonnull RecordFunction<T> function, @Nonnull FDBRecord<M> record)
RecordFunction
against a record.T
- the type of the resultfunction
- the function to evaluaterecord
- the record to evaluate against@Nonnull default <T> CompletableFuture<T> evaluateRecordFunction(@Nonnull EvaluationContext evaluationContext, @Nonnull RecordFunction<T> function, @Nonnull FDBRecord<M> record)
RecordFunction
against a record.T
- the type of the resultevaluationContext
- evaluation context containing parameter bindingsfunction
- the function to evaluaterecord
- the record to evaluate against@Nonnull <T> CompletableFuture<T> evaluateIndexRecordFunction(@Nonnull EvaluationContext evaluationContext, @Nonnull IndexRecordFunction<T> function, @Nonnull FDBRecord<M> record)
IndexRecordFunction
against a record.T
- the type of the resultevaluationContext
- evaluation context containing parameter bindingsfunction
- the function to evaluaterecord
- the record to evaluate against@Nonnull default <T> CompletableFuture<T> evaluateStoreFunction(@Nonnull StoreRecordFunction<T> function, @Nonnull FDBRecord<M> record)
StoreRecordFunction
against a record.T
- the type of the resultfunction
- the function to evaluaterecord
- the record to evaluate against@Nonnull <T> CompletableFuture<T> evaluateStoreFunction(@Nonnull EvaluationContext evaluationContext, @Nonnull StoreRecordFunction<T> function, @Nonnull FDBRecord<M> record)
StoreRecordFunction
against a record.T
- the type of the resultevaluationContext
- evaluation context containing parameter bindingsfunction
- the function to evaluaterecord
- the record to evaluate against@Nonnull default CompletableFuture<Tuple> evaluateAggregateFunction(@Nonnull EvaluationContext evaluationContext, @Nonnull List<String> recordTypeNames, @Nonnull IndexAggregateFunction aggregateFunction, @Nonnull TupleRange range, @Nonnull IsolationLevel isolationLevel)
IndexAggregateFunction
against a range of the store.
Before calling evaluateAggregateFunction(List, IndexAggregateFunction, TupleRange, IsolationLevel)
,
this overload adjusts the given range to include any prefix in the function itself.evaluationContext
- evaluation context containing parameter bindingsrecordTypeNames
- record types for which to find a matching indexaggregateFunction
- the function to evaluaterange
- the range of records (group) for which to evaluateisolationLevel
- whether to use snapshot reads@Nonnull default CompletableFuture<Tuple> evaluateAggregateFunction(@Nonnull List<String> recordTypeNames, @Nonnull IndexAggregateFunction aggregateFunction, @Nonnull Key.Evaluated value, @Nonnull IsolationLevel isolationLevel)
IndexAggregateFunction
against a group value.recordTypeNames
- record types for which to find a matching indexaggregateFunction
- the function to evaluatevalue
- the value for the group key(s)isolationLevel
- whether to use snapshot reads@Nonnull CompletableFuture<Tuple> evaluateAggregateFunction(@Nonnull List<String> recordTypeNames, @Nonnull IndexAggregateFunction aggregateFunction, @Nonnull TupleRange range, @Nonnull IsolationLevel isolationLevel)
IndexAggregateFunction
against a range of the store.recordTypeNames
- record types for which to find a matching indexaggregateFunction
- the function to evaluaterange
- the range of records (group) for which to evaluateisolationLevel
- whether to use snapshot reads@Nonnull default FDBQueriedRecord<M> queriedRecord(@Nonnull FDBStoredRecord<M> storedRecord)
storedRecord
- the stored record to convert to a queried recordFDBQueriedRecord
corresponding to storedRecord
@Nonnull default FDBQueriedRecord<M> queriedRecord(@Nonnull FDBIndexedRecord<M> indexedRecord)
indexedRecord
- the indexed record to convert to a queried recordFDBQueriedRecord
corresponding to indexedRecord
@Nonnull default FDBQueriedRecord<M> coveredIndexQueriedRecord(@Nonnull Index index, @Nonnull IndexEntry indexEntry, @Nonnull RecordType recordType, @Nonnull M partialRecord, boolean hasPrimaryKey)
StoredRecord
is not available, and the record only has fields from the index entry.
Normal indexes have a primary key in their entries, but aggregate indexes do not.index
- the index from which the entry cameindexEntry
- the index entryrecordType
- the record type of the indexed recordpartialRecord
- the partially populated Protobuf recordhasPrimaryKey
- whether the index entry has a primary keyFDBQueriedRecord
corresponding to indexEntry
@Nonnull default RecordCursor<FDBQueriedRecord<M>> executeQuery(@Nonnull RecordQuery query)
query
- the query to plan and executeRecordQueryPlan.execute(com.apple.foundationdb.record.provider.foundationdb.FDBRecordStoreBase<M>, com.apple.foundationdb.record.EvaluationContext, byte[], com.apple.foundationdb.record.ExecuteProperties)
@Nonnull default RecordCursor<FDBQueriedRecord<M>> executeQuery(@Nonnull RecordQuery query, @Nullable byte[] continuation, @Nonnull ExecuteProperties executeProperties)
query
- the query to plan and executecontinuation
- continuation from a previous execution of this same queryexecuteProperties
- limits on executionRecordQueryPlan.execute(com.apple.foundationdb.record.provider.foundationdb.FDBRecordStoreBase<M>, com.apple.foundationdb.record.EvaluationContext, byte[], com.apple.foundationdb.record.ExecuteProperties)
@Nonnull default RecordCursor<FDBQueriedRecord<M>> executeQuery(@Nonnull RecordQueryPlan query)
query
- the query to executeRecordQueryPlan.execute(com.apple.foundationdb.record.provider.foundationdb.FDBRecordStoreBase<M>, com.apple.foundationdb.record.EvaluationContext, byte[], com.apple.foundationdb.record.ExecuteProperties)
@Nonnull default RecordCursor<FDBQueriedRecord<M>> executeQuery(@Nonnull RecordQueryPlan query, @Nullable byte[] continuation, @Nonnull ExecuteProperties executeProperties)
query
- the query to executecontinuation
- continuation from a previous execution of this same planexecuteProperties
- limits on executionRecordQueryPlan.execute(com.apple.foundationdb.record.provider.foundationdb.FDBRecordStoreBase<M>, com.apple.foundationdb.record.EvaluationContext, byte[], com.apple.foundationdb.record.ExecuteProperties)
@Nonnull RecordQueryPlan planQuery(@Nonnull RecordQuery query)
query
- the query to planRecordQueryPlanner.plan(com.apple.foundationdb.record.query.RecordQuery)