Class PassThroughRecordStoreStateCache
- java.lang.Object
-
- com.apple.foundationdb.record.provider.foundationdb.storestate.PassThroughRecordStoreStateCache
-
- All Implemented Interfaces:
FDBRecordStoreStateCache
@API(EXPERIMENTAL) public class PassThroughRecordStoreStateCache extends Object implements FDBRecordStoreStateCache
An implementation of theFDBRecordStoreStateCache
interface that does not actually cache anything. This should be used if caching the record store state is not desired. For example, this might be the case if the cache miss rate is high and therefore keeping the machinery around to maintain the cache is not worth the cost. This is also the default implementation.Note that this class is a singleton as it requires no state.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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.static PassThroughRecordStoreStateCache
instance()
void
validateDatabase(FDBDatabase database)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.apple.foundationdb.record.provider.foundationdb.storestate.FDBRecordStoreStateCache
validateContext
-
-
-
-
Method Detail
-
get
@Nonnull public CompletableFuture<FDBRecordStoreStateCacheEntry> get(@Nonnull FDBRecordStore recordStore, @Nonnull FDBRecordStoreBase.StoreExistenceCheck existenceCheck)
Description copied from interface:FDBRecordStoreStateCache
Load the record store state for the record store stored at the given location. If this information is available in the cache, it will be served from memory without communicating with the database. Otherwise, the information may require performing network and disk I/O. Note that the cache entry returned should be consistent with the view of the database as viewed by the transaction provided as input. The cache implementations are generally differentiated by the manner in which they invalidate data to ensure that the value returned is consistent with this contract.This method should generally not be called by clients importing the Record Layer.
- Specified by:
get
in interfaceFDBRecordStoreStateCache
- Parameters:
recordStore
- the record store to load the store state ofexistenceCheck
- whether to error if the store does or does not exist- Returns:
- a future that will complete with the cached store state
-
validateDatabase
public void validateDatabase(@Nonnull FDBDatabase database)
- Specified by:
validateDatabase
in interfaceFDBRecordStoreStateCache
-
clear
public void clear()
Description copied from interface:FDBRecordStoreStateCache
Remove all entries from the cache.- Specified by:
clear
in interfaceFDBRecordStoreStateCache
-
instance
@Nonnull public static PassThroughRecordStoreStateCache instance()
-
-