Package one.microstream.storage.types
Class StorageEntityCache.Default
java.lang.Object
one.microstream.storage.types.StorageEntityCache.Default
- All Implemented Interfaces:
Unpersistable
,StorageChannelResetablePart
,StorageEntityCache<StorageEntity.Default>
,StorageHashChannelPart
- Enclosing interface:
- StorageEntityCache<I extends StorageEntityCacheItem<I>>
public static final class StorageEntityCache.Default extends Object implements StorageEntityCache<StorageEntity.Default>, Unpersistable
-
Nested Class Summary
Nested classes/interfaces inherited from interface one.microstream.storage.types.StorageEntityCache
StorageEntityCache.Default
-
Constructor Summary
Constructors Constructor Description Default()
-
Method Summary
Modifier and Type Method Description long
cacheSize()
int
channelIndex()
long
clearCache()
void
copyRoots(ChunksBuffer dataCollector)
static void
DEBUG_setGarbageCollectionEnabled(boolean enabled)
Deprecated.long
entityCount()
StorageEntity.Default
getEntry(long objectId)
boolean
incrementalGarbageCollection(long nanoTimeBudgetBound, StorageChannel channel)
Returnstrue
if there are no more oids to mark andfalse
if time ran out.boolean
incrementalLiveCheck(long nanoTimeBudgetBound)
boolean
issuedCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator entityEvaluator)
boolean
issuedGarbageCollection(long nanoTimeBudget, StorageChannel channel)
Returnstrue
if there are no more oids to mark andfalse
if time ran out.StorageEntityType.Default
lookupType(long typeId)
void
postStorePutEntities(ByteBuffer[] chunks, long[] chunksStoragePositions, StorageDataFile.Default dataFile)
void
reset()
Closes all resources (files, locks, etc.).StorageTypeDictionary
typeDictionary()
-
Constructor Details
-
Default
public Default()
-
-
Method Details
-
DEBUG_setGarbageCollectionEnabled
Deprecated./!\ Storage-level garbage collection is an unfinished feature with a still tiny race condition problem that can cause the database to be ruined occasionally.Enable at your own risk!
Also note that this method is a temporary experimental function for debugging purposes and can disappear at any release.
Do not use this is production mode.- Parameters:
enabled
-
-
reset
public final void reset()Description copied from interface:StorageChannelResetablePart
Closes all resources (files, locks, etc.). Clears all variable length items (cache, registry, etc.). Resets internal state to initial values. For itself and all its parts (entity cache, file manager, etc.). Basically a "back to just being born" action.- Specified by:
reset
in interfaceStorageChannelResetablePart
- Specified by:
reset
in interfaceStorageEntityCache<StorageEntity.Default>
-
getEntry
-
entityCount
public final long entityCount() -
channelIndex
public int channelIndex()- Specified by:
channelIndex
in interfaceStorageHashChannelPart
-
cacheSize
public final long cacheSize()- Specified by:
cacheSize
in interfaceStorageEntityCache<StorageEntity.Default>
-
clearCache
public final long clearCache()- Specified by:
clearCache
in interfaceStorageEntityCache<StorageEntity.Default>
-
typeDictionary
- Specified by:
typeDictionary
in interfaceStorageEntityCache<StorageEntity.Default>
-
postStorePutEntities
public void postStorePutEntities(ByteBuffer[] chunks, long[] chunksStoragePositions, StorageDataFile.Default dataFile) throws InterruptedException- Throws:
InterruptedException
-
lookupType
- Specified by:
lookupType
in interfaceStorageEntityCache<StorageEntity.Default>
-
copyRoots
- Specified by:
copyRoots
in interfaceStorageEntityCache<StorageEntity.Default>
-
incrementalLiveCheck
public final boolean incrementalLiveCheck(long nanoTimeBudgetBound)- Specified by:
incrementalLiveCheck
in interfaceStorageEntityCache<StorageEntity.Default>
-
issuedCacheCheck
- Specified by:
issuedCacheCheck
in interfaceStorageEntityCache<StorageEntity.Default>
-
issuedGarbageCollection
Returnstrue
if there are no more oids to mark andfalse
if time ran out. (Meaning the returned boolean effectively means "Was there enough time?")- Specified by:
issuedGarbageCollection
in interfaceStorageEntityCache<StorageEntity.Default>
-
incrementalGarbageCollection
public final boolean incrementalGarbageCollection(long nanoTimeBudgetBound, StorageChannel channel)Returnstrue
if there are no more oids to mark andfalse
if time ran out. (Meaning the returned boolean effectively means "Was there enough time?")- Specified by:
incrementalGarbageCollection
in interfaceStorageEntityCache<StorageEntity.Default>
-