Package one.microstream.storage.types
Class StorageChannel.Default
java.lang.Object
one.microstream.storage.types.StorageChannel.Default
- All Implemented Interfaces:
Runnable
,Unpersistable
,StorageActivePart
,StorageChannel
,StorageChannelResetablePart
,StorageHashChannelPart
,StorageHousekeepingExecutor
- Enclosing interface:
- StorageChannel
public static final class StorageChannel.Default extends Object implements StorageChannel, Unpersistable, StorageHousekeepingExecutor
-
Nested Class Summary
Nested classes/interfaces inherited from interface one.microstream.storage.types.StorageChannel
StorageChannel.Default, StorageChannel.EntityCollectorByOid, StorageChannel.EntityCollectorByTid, StorageChannel.HousekeepingTask
-
Constructor Summary
Constructors Constructor Description Default(int hashIndex, StorageExceptionHandler exceptionHandler, StorageTaskBroker taskBroker, StorageOperationController operationController, StorageHousekeepingBroker housekeepingBroker, StorageHousekeepingController housekeepingController, StorageEntityCache.Default entityCache, boolean switchByteOrder, BufferSizeProviderIncremental loadingBufferSizeProvider, StorageFileManager.Default fileManager, StorageEventLogger eventLogger)
-
Method Summary
-
Constructor Details
-
Default
public Default(int hashIndex, StorageExceptionHandler exceptionHandler, StorageTaskBroker taskBroker, StorageOperationController operationController, StorageHousekeepingBroker housekeepingBroker, StorageHousekeepingController housekeepingController, StorageEntityCache.Default entityCache, boolean switchByteOrder, BufferSizeProviderIncremental loadingBufferSizeProvider, StorageFileManager.Default fileManager, StorageEventLogger eventLogger)
-
-
Method Details
-
performIssuedGarbageCollection
public boolean performIssuedGarbageCollection(long nanoTimeBudget)- Specified by:
performIssuedGarbageCollection
in interfaceStorageHousekeepingExecutor
-
performIssuedFileCleanupCheck
public boolean performIssuedFileCleanupCheck(long nanoTimeBudget)- Specified by:
performIssuedFileCleanupCheck
in interfaceStorageHousekeepingExecutor
-
performIssuedEntityCacheCheck
public boolean performIssuedEntityCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator evaluator)- Specified by:
performIssuedEntityCacheCheck
in interfaceStorageHousekeepingExecutor
-
performFileCleanupCheck
public final boolean performFileCleanupCheck(long nanoTimeBudget)- Specified by:
performFileCleanupCheck
in interfaceStorageHousekeepingExecutor
-
performGarbageCollection
public boolean performGarbageCollection(long nanoTimeBudget)- Specified by:
performGarbageCollection
in interfaceStorageHousekeepingExecutor
-
performEntityCacheCheck
public boolean performEntityCacheCheck(long nanoTimeBudget)- Specified by:
performEntityCacheCheck
in interfaceStorageHousekeepingExecutor
-
issuedGarbageCollection
public final boolean issuedGarbageCollection(long nanoTimeBudget)- Specified by:
issuedGarbageCollection
in interfaceStorageChannel
-
issuedFileCleanupCheck
public boolean issuedFileCleanupCheck(long nanoTimeBudget)- Specified by:
issuedFileCleanupCheck
in interfaceStorageChannel
-
issuedEntityCacheCheck
public boolean issuedEntityCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator entityEvaluator)- Specified by:
issuedEntityCacheCheck
in interfaceStorageChannel
-
isActive
public boolean isActive()Description copied from interface:StorageActivePart
Queries whether the part is actually active right now. This might returntrue
even despite some "running" flag being set tofalse
because there might be one last loop cycle execution before checking the "running" flag again.- Specified by:
isActive
in interfaceStorageActivePart
- Returns:
- if the part is actually active right now.
-
run
public final void run() -
commitChunkStorage
public void commitChunkStorage()- Specified by:
commitChunkStorage
in interfaceStorageChannel
-
storeEntities
- Specified by:
storeEntities
in interfaceStorageChannel
-
postStoreUpdateEntityCache
public void postStoreUpdateEntityCache(ByteBuffer[] chunks, long[] chunksStoragePositions) throws InterruptedException- Specified by:
postStoreUpdateEntityCache
in interfaceStorageChannel
- Throws:
InterruptedException
-
channelIndex
public final int channelIndex()- Specified by:
channelIndex
in interfaceStorageHashChannelPart
-
typeDictionary
- Specified by:
typeDictionary
in interfaceStorageChannel
-
collectLoadByOids
- Specified by:
collectLoadByOids
in interfaceStorageChannel
-
collectLoadRoots
- Specified by:
collectLoadRoots
in interfaceStorageChannel
-
collectLoadByTids
- Specified by:
collectLoadByTids
in interfaceStorageChannel
-
exportData
- Specified by:
exportData
in interfaceStorageChannel
-
prepareImportData
- Specified by:
prepareImportData
in interfaceStorageChannel
-
importData
- Specified by:
importData
in interfaceStorageChannel
-
rollbackImportData
- Specified by:
rollbackImportData
in interfaceStorageChannel
-
commitImportData
public void commitImportData(long taskTimestamp)- Specified by:
commitImportData
in interfaceStorageChannel
-
exportTypeEntities
public final KeyValue<Long,Long> exportTypeEntities(StorageEntityTypeHandler type, AWritableFile file, Predicate<? super StorageEntity> predicateEntity) throws IOException- Specified by:
exportTypeEntities
in interfaceStorageChannel
- Throws:
IOException
-
exportTypeEntities
public final KeyValue<Long,Long> exportTypeEntities(StorageEntityTypeHandler type, AWritableFile file) throws IOException- Specified by:
exportTypeEntities
in interfaceStorageChannel
- Throws:
IOException
-
createRawFileStatistics
- Specified by:
createRawFileStatistics
in interfaceStorageChannel
-
rollbackChunkStorage
public final void rollbackChunkStorage()- Specified by:
rollbackChunkStorage
in interfaceStorageChannel
-
readStorage
- Specified by:
readStorage
in interfaceStorageChannel
-
initializeStorage
public final StorageIdAnalysis initializeStorage(long taskTimestamp, long consistentStoreTimestamp, StorageInventory storageInventory)- Specified by:
initializeStorage
in interfaceStorageChannel
-
reset
public final void reset()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
-
signalGarbageCollectionSweepCompleted
public final void signalGarbageCollectionSweepCompleted()- Specified by:
signalGarbageCollectionSweepCompleted
in interfaceStorageChannel
-
cleanupStore
public void cleanupStore()- Specified by:
cleanupStore
in interfaceStorageChannel
-