Package one.microstream.storage.types
Class StorageSystem.Default
- java.lang.Object
-
- one.microstream.storage.types.StorageSystem.Default
-
- All Implemented Interfaces:
AutoCloseable,one.microstream.persistence.types.Unpersistable,StorageActivePart,StorageController,StorageKillable,StorageSystem
- Enclosing interface:
- StorageSystem
public static final class StorageSystem.Default extends Object implements StorageSystem, one.microstream.persistence.types.Unpersistable, StorageKillable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface one.microstream.storage.types.StorageSystem
StorageSystem.Default
-
-
Constructor Summary
Constructors Constructor Description Default(StorageConfiguration storageConfiguration, StorageOperationController.Creator ocCreator, StorageDataFileValidator.Creator backupDataFileValidatorCreator, StorageWriteController writeController, StorageHousekeepingBroker housekeepingBroker, StorageFileWriter.Provider writerProvider, StorageInitialDataFileNumberProvider initialDataFileNumberProvider, StorageRequestAcceptor.Creator requestAcceptorCreator, StorageTaskBroker.Creator taskBrokerCreator, StorageDataChunkValidator.Provider dataChunkValidatorProvider, StorageChannelsCreator channelCreator, StorageThreadProvider threadProvider, StorageRequestTaskCreator requestTaskCreator, StorageTypeDictionary typeDictionary, StorageRootTypeIdProvider rootTypeIdProvider, StorageTimestampProvider timestampProvider, StorageObjectIdRangeEvaluator objectIdRangeEvaluator, StorageGCZombieOidHandler zombieOidHandler, StorageRootOidSelector.Provider rootOidSelectorProvider, StorageObjectIdMarkQueue.Creator oidMarkQueueCreator, StorageEntityMarkMonitor.Creator entityMarkMonitorCreator, boolean switchByteOrder, StorageLockFileSetup lockFileSetup, StorageLockFileManager.Creator lockFileManagerCreator, StorageExceptionHandler exceptionHandler, StorageEventLogger eventLogger, one.microstream.persistence.types.ObjectIdsSelector liveObjectIdChecker, one.microstream.reference.Referencing<one.microstream.persistence.types.PersistenceLiveStorerRegistry> refStorerRegistry, StorageStructureValidator storageStructureValidator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckAcceptingTasks()StorageConfigurationconfiguration()StorageRequestAcceptorcreateRequestAcceptor()StorageIdAnalysisinitializationIdAnalysis()longinitializationTime()booleanisAcceptingTasks()booleanisActive()Queries whether the part is actually active right now.booleanisRunning()booleanisShuttingDown()booleanisStartingUp()voidkillStorage(Throwable cause)Stops all threads, releases all resources (e.g.StorageObjectIdRangeEvaluatorobjectIdRangeEvaluator()StorageOperationControlleroperationController()longoperationModeTime()booleanshutdown()Issues a command to shut down all active threads managing the storage.StorageSystem.Defaultstart()"Starts" the storage controlled by thisStorageControllerinstance, with "starting" meaning:
Reading, indexing and potentially caching all the persisted data in the storage. Starting storage managing threads to execute requests like storing, loading and issued utility functions.StorageTypeDictionarytypeDictionary()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface one.microstream.storage.types.StorageController
close, initializationDuration, isShutdown
-
Methods inherited from interface one.microstream.storage.types.StorageSystem
channelCountProvider, fileSystem
-
-
-
-
Constructor Detail
-
Default
public Default(StorageConfiguration storageConfiguration, StorageOperationController.Creator ocCreator, StorageDataFileValidator.Creator backupDataFileValidatorCreator, StorageWriteController writeController, StorageHousekeepingBroker housekeepingBroker, StorageFileWriter.Provider writerProvider, StorageInitialDataFileNumberProvider initialDataFileNumberProvider, StorageRequestAcceptor.Creator requestAcceptorCreator, StorageTaskBroker.Creator taskBrokerCreator, StorageDataChunkValidator.Provider dataChunkValidatorProvider, StorageChannelsCreator channelCreator, StorageThreadProvider threadProvider, StorageRequestTaskCreator requestTaskCreator, StorageTypeDictionary typeDictionary, StorageRootTypeIdProvider rootTypeIdProvider, StorageTimestampProvider timestampProvider, StorageObjectIdRangeEvaluator objectIdRangeEvaluator, StorageGCZombieOidHandler zombieOidHandler, StorageRootOidSelector.Provider rootOidSelectorProvider, StorageObjectIdMarkQueue.Creator oidMarkQueueCreator, StorageEntityMarkMonitor.Creator entityMarkMonitorCreator, boolean switchByteOrder, StorageLockFileSetup lockFileSetup, StorageLockFileManager.Creator lockFileManagerCreator, StorageExceptionHandler exceptionHandler, StorageEventLogger eventLogger, one.microstream.persistence.types.ObjectIdsSelector liveObjectIdChecker, one.microstream.reference.Referencing<one.microstream.persistence.types.PersistenceLiveStorerRegistry> refStorerRegistry, StorageStructureValidator storageStructureValidator)
-
-
Method Detail
-
configuration
public final StorageConfiguration configuration()
- Specified by:
configurationin interfaceStorageSystem
-
isRunning
public final boolean isRunning()
- Specified by:
isRunningin interfaceStorageController
-
isActive
public final 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.
-
isAcceptingTasks
public final boolean isAcceptingTasks()
- Specified by:
isAcceptingTasksin interfaceStorageController
-
isStartingUp
public final boolean isStartingUp()
- Specified by:
isStartingUpin interfaceStorageController
-
isShuttingDown
public final boolean isShuttingDown()
- Specified by:
isShuttingDownin interfaceStorageController
-
initializationTime
public final long initializationTime()
- Specified by:
initializationTimein interfaceStorageController
-
operationModeTime
public final long operationModeTime()
- Specified by:
operationModeTimein interfaceStorageController
-
checkAcceptingTasks
public final void checkAcceptingTasks()
- Specified by:
checkAcceptingTasksin interfaceStorageController
-
start
public final StorageSystem.Default start()
Description copied from interface:StorageController"Starts" the storage controlled by thisStorageControllerinstance, with "starting" meaning:
- Reading, indexing and potentially caching all the persisted data in the storage.
- Starting storage managing threads to execute requests like storing, loading and issued utility functions.
- Specified by:
startin interfaceStorageController- Specified by:
startin interfaceStorageSystem- Returns:
- this to allow writing of fluent code.
-
initializationIdAnalysis
public final StorageIdAnalysis initializationIdAnalysis()
- Specified by:
initializationIdAnalysisin interfaceStorageSystem
-
shutdown
public final boolean shutdown()
Description copied from interface:StorageControllerIssues a command to shut down all active threads managing the storage.- Specified by:
shutdownin interfaceStorageController- Specified by:
shutdownin interfaceStorageSystem- Returns:
trueafter a successful shutdown orfalseif an internalInterruptedExceptionhappened.
-
typeDictionary
public final StorageTypeDictionary typeDictionary()
- Specified by:
typeDictionaryin interfaceStorageSystem
-
operationController
public StorageOperationController operationController()
- Specified by:
operationControllerin interfaceStorageSystem
-
objectIdRangeEvaluator
public StorageObjectIdRangeEvaluator objectIdRangeEvaluator()
- Specified by:
objectIdRangeEvaluatorin interfaceStorageSystem
-
createRequestAcceptor
public final StorageRequestAcceptor createRequestAcceptor()
- Specified by:
createRequestAcceptorin interfaceStorageSystem
-
killStorage
public void killStorage(Throwable cause)
Description copied from interface:StorageKillableStops all threads, releases all resources (e.g. close files) without considering any internal state or waiting for any action to be completed.Useful only in simple error cases, for example
- Specified by:
killStoragein interfaceStorageKillable- Parameters:
cause- the reason for the kill
-
-