Package com.apple.foundationdb.record.provider.foundationdb
Classes for FoundationDB record storage.
Note that at present FoundationDB is the only supported backend.
Databases
An FDB cluster is represented by an FDBDatabase
, which is gotten from an FDBDatabaseFactory
.
All operations are transactional: a transaction is represented by an FDBRecordContext
, which is opened from a database.
Record Stores
Records are read and written by an FDBRecordStore
, which is opened within a record context using a FDBRecordStore.Builder
.
Storing a Protobuf Message
as a record in a record store produces an FDBStoredRecord
, which associates it with a record type and primary key.
Retrieving a record by primary key from the record store also returns a stored record.
A query returns a RecordCursor
of FDBQueriedRecord
s, which extend FDBStoredRecord
.
-
Interface Summary Interface Description FDBDatabase.ExceptionMapper Function for mapping an underlying exception to a synchronous failure.FDBDatabaseRunner A context for running against anFDBDatabase
with retrying of transient exceptions.FDBIndexableRecord<M extends Message> A record that can be passed to an index maintainer.FDBLocalityProvider An interface containing a set of functions for discovering the location of the keys within a cluster.FDBRecord<M extends Message> A record associated with the corresponding meta-data.FDBRecordContext.AfterCommit A hook to run after commit has completed successfully.FDBRecordContext.CommitCheck A synchronousFDBRecordContext.CommitCheckAsync
.FDBRecordContext.CommitCheckAsync A consistency check, such as uniqueness, that can execute asynchronously and is finally checked at or before commit time.FDBRecordContext.PostCommit A supplier of a future to be executed after the transaction has been successfully committed.FDBRecordStoreBase<M extends Message> Base interface for typed and untyped record stores.FDBRecordStoreBase.BaseBuilder<M extends Message,R extends FDBRecordStoreBase<M>> Builder forFDBRecordStoreBase
.FDBRecordStoreBase.PipelineSizer Function for computing the number of elements to allow in the asynchronous pipeline for an operation of the given type.FDBRecordStoreBase.UserVersionChecker Hook for checking if store state for client changes.FDBStoredSizes Information about how a record is stored in the database.IndexMaintainerFactory A factory forIndexMaintainer
.IndexMaintainerRegistry A registry ofIndexMaintainer
s.IndexMaintenanceFilter A hook for suppressing secondary indexing of some records.MetaDataCache A caching hook forFDBMetaDataStore
.SubspaceProvider Subspace provider can provide a subspace (might be blocking) and logging information to the subspace (non-blocking). -
Class Summary Class Description FDBDatabase A known FDBDatabase
, associated with a cluster file location.FDBDatabase.WeakReadSemantics 1.FDBDatabaseFactory A singleton maintaining a list ofFDBDatabase
instances, indexed by their cluster file location.FDBDatabaseRunnerImpl The standard implementation ofFDBDatabaseRunner
.FDBExceptions Namespace for exceptions that wrap the underlying exceptions from the FDB API.FDBIndexedRecord<M extends Message> A record that has been loaded via an index.FDBLocalityUtil An implementation of theFDBLocalityProvider
interface that uses foundationDB'sLocalityUtil
API to discover the storage locations of keys within a cluster.FDBMetaDataStore Serialization ofRecordMetaData
into the database.FDBQueriedRecord<M extends Message> A record returned by a query and therefore possibly associated with a particular entry in some index.FDBRecordContext An open transaction against FDB.FDBRecordContextConfig A configuration struct that can be used to set various options on anFDBRecordContext
.FDBRecordContextConfig.Builder A builder ofFDBRecordContextConfig
s using the standard builder pattern.FDBRecordStore A multi-type record store.FDBRecordStore.Builder A builder forFDBRecordStore
.FDBRecordVersion Class representing a specific version within FDB.FDBReverseDirectoryCache A persistent cache providing reverse lookup facilities from the FDBDirectoryLayer
.FDBStoreBase Base class for record stores and meta-data stores, which have in common that they are opened by anFDBRecordContext
and occupy someSubspace
in the database.FDBStoredRecord<M extends Message> A record stored in the database.FDBStoredRecordBuilder<M extends Message> A builder forFDBStoredRecord
.FDBStoreTimer AStoreTimer
associated withFDBRecordStore
operations.FDBSyntheticRecord A record synthesized from stored records.FDBSystemOperations View of an FoundationDB database used for accessing system and special keys.FDBTransactionContext Wrapper class for an open FDBTransaction
.FDBTypedRecordStore<M extends Message> A type-safe record store.FDBTypedRecordStore.Builder<M extends Message> A builder forFDBTypedRecordStore
.IndexAggregateGroupKeys Helper class for extracting grouping keys from anIndexAggregateFunction
given query conditions.IndexAggregateGroupKeys.Conditions IndexAggregateGroupKeys.IndexScan IndexBuildState A class that contains the build progress of a given index in a given record store.IndexFunctionHelper Helper class for finding appropriate indexes forIndexRecordFunction
andIndexAggregateFunction
.IndexMaintainer Object responsible for translating record saves and deletes into updates to a secondary index.IndexMaintainerRegistryImpl A singletonIndexMaintainerRegistry
that findsIndexMaintainerFactory
classes in the classpath.IndexMaintainerState Common state for anIndexMaintainer
.IndexOperation A maintenance operation on a secondary index.IndexOperationResult The result of anIndexOperation
.InstrumentedTransaction Wrapper aroundTransaction
that instruments certain calls to expose their behavior withFDBStoreTimer
metrics.KeyValueCursor The basic cursor for scanning ranges of the FDB database.KeyValueCursor.Builder A builder forKeyValueCursor
.MetaDataProtoEditor A helper class for mutating the meta-data proto.OnlineIndexer Builds an index online, i.e., concurrently with other database operations.OnlineIndexer.Builder Builder forOnlineIndexer
.OnlineIndexer.Config A holder for the mutable configuration parameters needed to rebuild an online index.OnlineIndexer.Config.Builder A builder forOnlineIndexer.Config
.SplitHelper Helper classes for splitting records across multiple key-value pairs.SplitHelper.KeyValueUnsplitter This cursor may exceed out-of-band limits in order to ensure that it only ever stops in between (split) records.SplitHelper.SingleKeyUnsplitter Unsplit a single record from a given range scan.SplitHelper.SizeInfo Accumulator for key-value sizes while loading / saving split records.SubspaceProviderByKeySpacePath A SubspaceProvider wrapping a key space path.SubspaceProviderBySubspace A SubspaceProvider wrapping a subspace. -
Enum Summary Enum Description BlockingInAsyncDetection Indicates whetherFDBDatabase.asyncToSync(FDBStoreTimer, FDBStoreTimer.Wait, java.util.concurrent.CompletableFuture)
orFDBRecordContext.asyncToSync(FDBStoreTimer.Wait, java.util.concurrent.CompletableFuture)
should attempt to detect when it is being called from an asynchronous context and, if so, how it should react to this fact.FDBLatencySource Indicates which FDB API calls are to have latency injected into them viaFDBDatabaseFactory.setLatencyInjector(Function)
.FDBRecordStore.RebuildIndexReason Reason that an index is being rebuilt now.FDBRecordStoreBase.RecordExistenceCheck Action to take if the record being saved does / does not already exist.FDBRecordStoreBase.StoreExistenceCheck Action to take if the record store does / does not already exist.FDBRecordStoreBase.VersionstampSaveBehavior Provided during record save (viaFDBRecordStoreBase.saveRecord(Message, FDBRecordVersion, VersionstampSaveBehavior)
), directs the behavior of the save w.r.t.FDBRecordStoreKeyspace Unique integers used as the first tuple item within a record store's subspace.FDBStoreTimer.CountAggregates An aggregate over other count events.FDBStoreTimer.Counts StandardStoreTimer.Count
events.FDBStoreTimer.DetailEvents StandardStoreTimer.DetailEvent
s.FDBStoreTimer.Events Ordinary top-level events which surround a single body of code.FDBStoreTimer.Waits StandardStoreTimer.Wait
events.FDBTraceFormat The FoundationDB native client can be configured to emit its trace logs (containing important metrics and instrumentation information) in one of several different formats.FDBTransactionPriority An enum indicating the priority of transactions against FoundationDB.IndexMaintenanceFilter.IndexValues Whether to maintain a subset of the indexable values for the given record.IndexOrphanBehavior Provided during index scan operations in which associated records are being retrieved, to indicate what should happen in response to an index entry which has no associated record.OnlineIndexer.IndexStatePrecondition This defines in which situations the index should be built. -
Exception Summary Exception Description BlockingInAsyncException Exception thrown whenasyncToSync
detects that it is being called from within an asynchronous context.FDBDatabaseRunner.RunnerClosed Exception thrown whenFDBDatabaseRunner
has been closed but tries to do work.FDBExceptions.FDBStoreException Exceptions that are reported by (or due to limitations of, etc.) the FDB API.FDBExceptions.FDBStoreKeySizeException Exception thrown when key size is exceeded.FDBExceptions.FDBStoreRetriableException An exception that should be retried by the caller because is stems from a transient condition in FDB.FDBExceptions.FDBStoreTransactionConflictException Transaction failed due to a conflict with another transaction.FDBExceptions.FDBStoreTransactionIsTooOldException Transaction is too old to perform reads or be committed.FDBExceptions.FDBStoreTransactionSizeException Exception thrown when transaction size is exceeded.FDBExceptions.FDBStoreTransactionTimeoutException Exception thrown when a transaction times out.FDBExceptions.FDBStoreValueSizeException Exception thrown when value size is exceeded.FDBMetaDataStore.MissingMetaDataException Thrown if meta-data was never written to the store.FDBRecordStore.IndexNotBuiltException Exception that can be thrown if one attempts to mark an index as readable if it is not yet readable.FDBRecordVersion.IncompleteRecordVersionException Exception that can be thrown if one tries to get the global version associated with a version whose global version has not yet been set.MetaDataProtoEditor.AmbiguousTypeNameException An exception that is thrown if the type of a field is ambiguous.OnlineIndexer.RecordBuiltRangeException ThisException
can be thrown in the case that one calls one of the methods that explicitly state that they are building an unbuilt range, i.e., a range of keys that contains no keys which have yet been processed by theOnlineIndexer
during an index build.RecordAlreadyExistsException Exception thrown whenFDBRecordStoreBase.insertRecord(M)
is called, but the record already exists.RecordDoesNotExistException Exception thrown whenFDBRecordStoreBase.updateRecord(M)
is called, but the record does not exist yet.RecordStoreAlreadyExistsException Exception thrown whenFDBRecordStoreBase.BaseBuilder.create()
is called, but the record store already exists.RecordStoreDoesNotExistException Exception thrown whenFDBRecordStoreBase.BaseBuilder.open()
is called, but the record store does not exist yet.RecordStoreNoInfoAndNotEmptyException Exception thrown whenFDBRecordStoreBase.BaseBuilder.createOrOpen()
is called, and the record store does not have a store info header, but does have something else.RecordStoreStaleMetaDataVersionException Exception thrown when the record store has a newer meta-data version than the one from the givenRecordMetaDataProvider
.RecordStoreStaleUserVersionException Exception thrown when the record store has a newer user version than the one from the givenFDBRecordStoreBase.UserVersionChecker
.RecordTypeChangedException Exception thrown whenFDBRecordStoreBase.updateRecord(M)
is called, but the existing record has a different record type.ScanNonReadableIndexException An exception that can be thrown byFDBRecordStore
s if they are scanning non-readable indexes.SplitHelper.FoundSplitWithoutStartException Exception thrown when only part of a split record is found.UninitializedRecordStoreException An exception that can be thrown byFDBRecordStore
s if they are used before they have been properly initialized.UnsupportedFormatVersionException Exception thrown when a record store has a format version in the database that is not supported by this codebase.