@API(value=EXPERIMENTAL) public class ReadVersionRecordStoreStateCache extends Object implements FDBRecordStoreStateCache
FDBRecordStoreStateCache
that uses the read-version of the associated transaction
as the cache invalidation key. In general, it is not particularly likely that multiple transactions started
against the same database will share the same read version, so without any other work, this cache should be
expected to have a rather low hit-rate. However, when combined with version-caching and setting the
weak read semantics
of a context to use cached read versions, one can greatly increase the cache hit rate. This means that in cases where stale
reads are acceptable and many transactions share the same read version, opening the same record store multiple times
with the same read version (even if the transactions are different) can be made very cheap.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.
|
void |
validateDatabase(FDBDatabase database) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
validateContext
@Nonnull public CompletableFuture<FDBRecordStoreStateCacheEntry> get(@Nonnull FDBRecordStore recordStore, @Nonnull FDBRecordStoreBase.StoreExistenceCheck existenceCheck)
FDBRecordStoreStateCache
This method should generally not be called by clients importing the Record Layer.
get
in interface FDBRecordStoreStateCache
recordStore
- the record store to load the store state ofexistenceCheck
- whether to error if the store does or does not existpublic void validateDatabase(@Nonnull FDBDatabase database)
validateDatabase
in interface FDBRecordStoreStateCache
public void clear()
FDBRecordStoreStateCache
clear
in interface FDBRecordStoreStateCache