Package one.microstream.storage.types
Class StorageSystem.Default
java.lang.Object
one.microstream.storage.types.StorageSystem.Default
- All Implemented Interfaces:
AutoCloseable
,Unpersistable
,StorageActivePart
,StorageController
,StorageKillable
,StorageSystem
- Enclosing interface:
- StorageSystem
public static final class StorageSystem.Default extends Object implements StorageSystem, Unpersistable, StorageKillable
-
Nested Class Summary
Nested classes/interfaces inherited from interface one.microstream.storage.types.StorageSystem
StorageSystem.Default
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description void
checkAcceptingTasks()
StorageConfiguration
configuration()
StorageRequestAcceptor
createRequestAcceptor()
StorageIdAnalysis
initializationIdAnalysis()
long
initializationTime()
boolean
isAcceptingTasks()
boolean
isActive()
Queries whether the part is actually active right now.boolean
isRunning()
boolean
isShuttingDown()
boolean
isStartingUp()
void
killStorage(Throwable cause)
Stops all threads, releases all resources (e.g.StorageObjectIdRangeEvaluator
objectIdRangeEvaluator()
StorageOperationController
operationController()
long
operationModeTime()
boolean
shutdown()
Issues a command to shut down all active threads managing the storage.StorageSystem.Default
start()
"Starts" the storage controlled by thisStorageController
instance, 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.StorageTypeDictionary
typeDictionary()
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 Details
-
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)
-
-
Method Details
-
configuration
- Specified by:
configuration
in interfaceStorageSystem
-
isRunning
public final boolean isRunning()- Specified by:
isRunning
in interfaceStorageController
-
isActive
public final 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.
-
isAcceptingTasks
public final boolean isAcceptingTasks()- Specified by:
isAcceptingTasks
in interfaceStorageController
-
isStartingUp
public final boolean isStartingUp()- Specified by:
isStartingUp
in interfaceStorageController
-
isShuttingDown
public final boolean isShuttingDown()- Specified by:
isShuttingDown
in interfaceStorageController
-
initializationTime
public final long initializationTime()- Specified by:
initializationTime
in interfaceStorageController
-
operationModeTime
public final long operationModeTime()- Specified by:
operationModeTime
in interfaceStorageController
-
checkAcceptingTasks
public final void checkAcceptingTasks()- Specified by:
checkAcceptingTasks
in interfaceStorageController
-
start
Description copied from interface:StorageController
"Starts" the storage controlled by thisStorageController
instance, 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:
start
in interfaceStorageController
- Specified by:
start
in interfaceStorageSystem
- Returns:
- this to allow writing of fluent code.
-
initializationIdAnalysis
- Specified by:
initializationIdAnalysis
in interfaceStorageSystem
-
shutdown
public final boolean shutdown()Description copied from interface:StorageController
Issues a command to shut down all active threads managing the storage.- Specified by:
shutdown
in interfaceStorageController
- Specified by:
shutdown
in interfaceStorageSystem
- Returns:
true
after a successful shutdown orfalse
if an internalInterruptedException
happened.
-
typeDictionary
- Specified by:
typeDictionary
in interfaceStorageSystem
-
operationController
- Specified by:
operationController
in interfaceStorageSystem
-
objectIdRangeEvaluator
- Specified by:
objectIdRangeEvaluator
in interfaceStorageSystem
-
createRequestAcceptor
- Specified by:
createRequestAcceptor
in interfaceStorageSystem
-
killStorage
Description copied from interface:StorageKillable
Stops 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:
killStorage
in interfaceStorageKillable
-