Package one.microstream.storage.types
Class StorageChannel.Default
- java.lang.Object
-
- one.microstream.storage.types.StorageChannel.Default
-
- All Implemented Interfaces:
Runnable,one.microstream.persistence.types.Unpersistable,StorageActivePart,StorageChannel,StorageChannelResetablePart,StorageHashChannelPart,StorageHousekeepingExecutor,one.microstream.typing.Disposable
- Enclosing interface:
- StorageChannel
public static final class StorageChannel.Default extends Object implements StorageChannel, one.microstream.persistence.types.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, one.microstream.util.BufferSizeProviderIncremental loadingBufferSizeProvider, StorageFileManager.Default fileManager, StorageEventLogger eventLogger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intchannelIndex()voidcleanupStore()ChunksBuffercollectLoadByOids(ChunksBuffer[] resultArray, one.microstream.persistence.types.PersistenceIdSet loadOids)ChunksBuffercollectLoadByTids(ChunksBuffer[] resultArray, one.microstream.persistence.types.PersistenceIdSet loadTids)ChunksBuffercollectLoadRoots(ChunksBuffer[] resultArray)voidcommitChunkStorage()voidcommitImportData(long taskTimestamp)StorageRawFileStatistics.ChannelStatisticscreateRawFileStatistics()voiddispose()voidexportData(StorageLiveFileProvider fileProvider)one.microstream.typing.KeyValue<Long,Long>exportTypeEntities(StorageEntityTypeHandler type, one.microstream.afs.types.AWritableFile file)one.microstream.typing.KeyValue<Long,Long>exportTypeEntities(StorageEntityTypeHandler type, one.microstream.afs.types.AWritableFile file, Predicate<? super StorageEntity> predicateEntity)voidimportData(StorageImportSource importSource)StorageIdAnalysisinitializeStorage(long taskTimestamp, long consistentStoreTimestamp, StorageInventory storageInventory)booleanisActive()Queries whether the part is actually active right now.booleanissuedEntityCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator entityEvaluator)booleanissuedFileCleanupCheck(long nanoTimeBudget)booleanissuedGarbageCollection(long nanoTimeBudget)booleanperformEntityCacheCheck(long nanoTimeBudget)booleanperformFileCleanupCheck(long nanoTimeBudget)booleanperformGarbageCollection(long nanoTimeBudget)booleanperformIssuedEntityCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator evaluator)booleanperformIssuedFileCleanupCheck(long nanoTimeBudget)booleanperformIssuedGarbageCollection(long nanoTimeBudget)voidpostStoreUpdateEntityCache(ByteBuffer[] chunks, long[] chunksStoragePositions)StorageEntityCache.DefaultprepareImportData()StorageInventoryreadStorage()voidreset()Closes all resources (files, locks, etc.).voidrollbackChunkStorage()voidrollbackImportData(Throwable cause)voidrun()voidsignalGarbageCollectionSweepCompleted()one.microstream.typing.KeyValue<ByteBuffer[],long[]>storeEntities(long timestamp, Chunk chunkData)StorageTypeDictionarytypeDictionary()
-
-
-
Constructor Detail
-
Default
public Default(int hashIndex, StorageExceptionHandler exceptionHandler, StorageTaskBroker taskBroker, StorageOperationController operationController, StorageHousekeepingBroker housekeepingBroker, StorageHousekeepingController housekeepingController, StorageEntityCache.Default entityCache, boolean switchByteOrder, one.microstream.util.BufferSizeProviderIncremental loadingBufferSizeProvider, StorageFileManager.Default fileManager, StorageEventLogger eventLogger)
-
-
Method Detail
-
performIssuedGarbageCollection
public boolean performIssuedGarbageCollection(long nanoTimeBudget)
- Specified by:
performIssuedGarbageCollectionin interfaceStorageHousekeepingExecutor
-
performIssuedFileCleanupCheck
public boolean performIssuedFileCleanupCheck(long nanoTimeBudget)
- Specified by:
performIssuedFileCleanupCheckin interfaceStorageHousekeepingExecutor
-
performIssuedEntityCacheCheck
public boolean performIssuedEntityCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator evaluator)- Specified by:
performIssuedEntityCacheCheckin interfaceStorageHousekeepingExecutor
-
performFileCleanupCheck
public final boolean performFileCleanupCheck(long nanoTimeBudget)
- Specified by:
performFileCleanupCheckin interfaceStorageHousekeepingExecutor
-
performGarbageCollection
public boolean performGarbageCollection(long nanoTimeBudget)
- Specified by:
performGarbageCollectionin interfaceStorageHousekeepingExecutor
-
performEntityCacheCheck
public boolean performEntityCacheCheck(long nanoTimeBudget)
- Specified by:
performEntityCacheCheckin interfaceStorageHousekeepingExecutor
-
issuedGarbageCollection
public final boolean issuedGarbageCollection(long nanoTimeBudget)
- Specified by:
issuedGarbageCollectionin interfaceStorageChannel
-
issuedFileCleanupCheck
public boolean issuedFileCleanupCheck(long nanoTimeBudget)
- Specified by:
issuedFileCleanupCheckin interfaceStorageChannel
-
issuedEntityCacheCheck
public boolean issuedEntityCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator entityEvaluator)- Specified by:
issuedEntityCacheCheckin interfaceStorageChannel
-
isActive
public boolean isActive()
Description copied from interface:StorageActivePartQueries whether the part is actually active right now. This might returntrueeven despite some "running" flag being set tofalsebecause there might be one last loop cycle execution before checking the "running" flag again.- Specified by:
isActivein interfaceStorageActivePart- Returns:
- if the part is actually active right now.
-
commitChunkStorage
public void commitChunkStorage()
- Specified by:
commitChunkStoragein interfaceStorageChannel
-
storeEntities
public one.microstream.typing.KeyValue<ByteBuffer[],long[]> storeEntities(long timestamp, Chunk chunkData)
- Specified by:
storeEntitiesin interfaceStorageChannel
-
postStoreUpdateEntityCache
public void postStoreUpdateEntityCache(ByteBuffer[] chunks, long[] chunksStoragePositions) throws InterruptedException
- Specified by:
postStoreUpdateEntityCachein interfaceStorageChannel- Throws:
InterruptedException
-
channelIndex
public final int channelIndex()
- Specified by:
channelIndexin interfaceStorageHashChannelPart
-
typeDictionary
public final StorageTypeDictionary typeDictionary()
- Specified by:
typeDictionaryin interfaceStorageChannel
-
collectLoadByOids
public final ChunksBuffer collectLoadByOids(ChunksBuffer[] resultArray, one.microstream.persistence.types.PersistenceIdSet loadOids)
- Specified by:
collectLoadByOidsin interfaceStorageChannel
-
collectLoadRoots
public final ChunksBuffer collectLoadRoots(ChunksBuffer[] resultArray)
- Specified by:
collectLoadRootsin interfaceStorageChannel
-
collectLoadByTids
public final ChunksBuffer collectLoadByTids(ChunksBuffer[] resultArray, one.microstream.persistence.types.PersistenceIdSet loadTids)
- Specified by:
collectLoadByTidsin interfaceStorageChannel
-
exportData
public final void exportData(StorageLiveFileProvider fileProvider)
- Specified by:
exportDatain interfaceStorageChannel
-
prepareImportData
public StorageEntityCache.Default prepareImportData()
- Specified by:
prepareImportDatain interfaceStorageChannel
-
importData
public void importData(StorageImportSource importSource)
- Specified by:
importDatain interfaceStorageChannel
-
rollbackImportData
public void rollbackImportData(Throwable cause)
- Specified by:
rollbackImportDatain interfaceStorageChannel
-
commitImportData
public void commitImportData(long taskTimestamp)
- Specified by:
commitImportDatain interfaceStorageChannel
-
exportTypeEntities
public final one.microstream.typing.KeyValue<Long,Long> exportTypeEntities(StorageEntityTypeHandler type, one.microstream.afs.types.AWritableFile file, Predicate<? super StorageEntity> predicateEntity) throws IOException
- Specified by:
exportTypeEntitiesin interfaceStorageChannel- Throws:
IOException
-
exportTypeEntities
public final one.microstream.typing.KeyValue<Long,Long> exportTypeEntities(StorageEntityTypeHandler type, one.microstream.afs.types.AWritableFile file) throws IOException
- Specified by:
exportTypeEntitiesin interfaceStorageChannel- Throws:
IOException
-
createRawFileStatistics
public final StorageRawFileStatistics.ChannelStatistics createRawFileStatistics()
- Specified by:
createRawFileStatisticsin interfaceStorageChannel
-
rollbackChunkStorage
public final void rollbackChunkStorage()
- Specified by:
rollbackChunkStoragein interfaceStorageChannel
-
readStorage
public final StorageInventory readStorage()
- Specified by:
readStoragein interfaceStorageChannel
-
initializeStorage
public final StorageIdAnalysis initializeStorage(long taskTimestamp, long consistentStoreTimestamp, StorageInventory storageInventory)
- Specified by:
initializeStoragein 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:
resetin interfaceStorageChannelResetablePart
-
signalGarbageCollectionSweepCompleted
public final void signalGarbageCollectionSweepCompleted()
- Specified by:
signalGarbageCollectionSweepCompletedin interfaceStorageChannel
-
cleanupStore
public void cleanupStore()
- Specified by:
cleanupStorein interfaceStorageChannel
-
dispose
public final void dispose()
- Specified by:
disposein interfaceone.microstream.typing.Disposable
-
-