@API(value=EXPERIMENTAL) public interface FDBRecordStoreStateCache
FDBRecordStoreStateCacheEntry
objects. These cache entries contain information necessary
to initialize a record store, so caching this information can make accessing a record store multiple times
in quick succession cheaper both in that latency is saved at record store creation time. Additionally, in scenarios
when a client is connecting to a very small number of record stores, loading this information from disk can
load potential hot keys which can generally degrade cluster performance. Caching this information avoids performing
those reads.
Note that if the client is connecting to multiple clusters, there should be one cache per cluster. In general, as
there is one FDBDatabase
object per cluster,
it is sufficient to provide a FDBRecordStoreStateCacheFactory
to the
FDBDatabaseFactory
singleton. One can also provide a cache instance to an FDBRecordStore
at build time.
Clients should generally not call methods defined on this interface, as they are intended mainly for internal use within the Record Layer.
Modifier and Type | Method and Description |
---|---|
void |
clear()
Remove all entries from the cache.
|
CompletableFuture<FDBRecordStoreStateCacheEntry> |
get(FDBRecordStore recordStore,
FDBRecordStoreBase.StoreExistenceCheck existenceCheck)
Load the record store state for the record store stored at the given location.
|
default void |
validateContext(FDBRecordContext context) |
void |
validateDatabase(FDBDatabase database) |
@API(value=INTERNAL) @Nonnull CompletableFuture<FDBRecordStoreStateCacheEntry> get(@Nonnull FDBRecordStore recordStore, @Nonnull FDBRecordStoreBase.StoreExistenceCheck existenceCheck)
This method should generally not be called by clients importing the Record Layer.
recordStore
- the record store to load the store state ofexistenceCheck
- whether to error if the store does or does not exist@API(value=INTERNAL) void validateDatabase(@Nonnull FDBDatabase database)
@API(value=INTERNAL) default void validateContext(@Nonnull FDBRecordContext context)
void clear()