Class Storage
- java.lang.Object
-
- one.microstream.storage.types.Storage
-
public final class Storage extends Object
Static utility class containing static pseudo-constructor methods (indicated by a capital first letter) and various utility methods.To setup and start a database, see the class "EmbeddedStorage".
- See Also:
Persistence,StorageChannel
-
-
Constructor Summary
Constructors Constructor Description Storage()
-
Method Summary
Modifier and Type Method Description static StorageBackupSetupBackupSetup(File backupDirectory)Deprecated.static StorageBackupSetupBackupSetup(String backupDirectoryPath)Pseudo-constructor method to create a newStorageBackupSetupinstance using the passed directory as the backup location.static StorageBackupSetupBackupSetup(Path backupDirectory)static StorageBackupSetupBackupSetup(StorageFileProvider backupFileProvider)Pseudo-constructor method to create a newStorageBackupSetupinstance using the passedStorageFileProvider.static StorageChannelCountProviderChannelCountProvider()Pseudo-constructor method to create a newStorageChannelCountProviderinstance using default values defined byStorageChannelCountProvider.Defaults.static StorageChannelCountProviderChannelCountProvider(int channelCount)Pseudo-constructor method to create a newStorageChannelCountProviderinstance using the passed value.static StorageConfigurationConfiguration()Pseudo-constructor method to create a newStorageConfigurationinstance usingnullas theStorageBackupSetuppart and default instances for everything else.static StorageConfigurationConfiguration(StorageFileProvider fileProvider)Pseudo-constructor method to create a newStorageConfigurationinstance using the passedStorageFileProvider,nullas theStorageBackupSetuppart and default instances for everything else.static StorageConfiguration.Builder<?>ConfigurationBuilder()Pseudo-constructor method to create a newStorageConfiguration.Builderinstance.static <C extends StorageConnection>
Cconsolidate(C storageConnection)Callsconsolidate(StorageConnection,StorageDataFileDissolvingEvaluator,StorageEntityCacheEvaluator)with null as additional parameters (causing live configuration to be used instead).static <C extends StorageConnection>
Cconsolidate(C storageConnection, StorageDataFileDissolvingEvaluator fileDissolver)Callsconsolidate(StorageConnection,StorageDataFileDissolvingEvaluator,StorageEntityCacheEvaluator)with null as additional parameters (causing live configuration to be used instead).static <C extends StorageConnection>
Cconsolidate(C storageConnection, StorageDataFileDissolvingEvaluator fileDissolver, StorageEntityCacheEvaluator entityEvaluator)Consolidates the storage system represented by the passedStorageConnectionby callingStorageConnection.issueFullGarbageCollection()
StorageConnection.issueFullFileCheck(StorageDataFileDissolvingEvaluator)
StorageConnection.issueFullCacheCheck(StorageEntityCacheEvaluator)
in that order.static <C extends StorageConnection>
Cconsolidate(C storageConnection, StorageEntityCacheEvaluator entityEvaluator)Callsconsolidate(StorageConnection,StorageDataFileDissolvingEvaluator,StorageEntityCacheEvaluator)with null as additional parameters (causing live configuration to be used instead).static StorageDataFileEvaluatorDataFileEvaluator()Pseudo-constructor method to create a newStorageDataFileEvaluatorinstance using default values specified byStorageDataFileEvaluator.Defaults.static StorageDataFileEvaluatorDataFileEvaluator(int fileMinimumSize, int fileMaximumSize)Pseudo-constructor method to create a newStorageDataFileEvaluatorinstance using the passed values and default values specified byStorageDataFileEvaluator.Defaults.static StorageDataFileEvaluatorDataFileEvaluator(int fileMinimumSize, int fileMaximumSize, double minimumUseRatio)Pseudo-constructor method to create a newStorageDataFileEvaluatorinstance using the passed values.static StorageDataFileEvaluatorDataFileEvaluator(int fileMinimumSize, int fileMaximumSize, double minimumUseRatio, boolean cleanUpHeadFile)Pseudo-constructor method to create a newStorageDataFileEvaluatorinstance using the passed values and default values specified byStorageDataFileEvaluator.Defaults.static StorageEntityCacheEvaluatorEntityCacheEvaluator()Pseudo-constructor method to create a newStorageEntityCacheEvaluatorinstance using default values defined byStorageEntityCacheEvaluator.Defaults.static StorageEntityCacheEvaluatorEntityCacheEvaluator(long timeoutMs)Pseudo-constructor method to create a newStorageEntityCacheEvaluatorinstance using the passed value and default values defined byStorageEntityCacheEvaluator.Defaults.static StorageEntityCacheEvaluatorEntityCacheEvaluator(long timeoutMs, long threshold)Pseudo-constructor method to create a newStorageEntityCacheEvaluatorinstance using the passed values.static StorageFileProviderFileProvider()Pseudo-constructor method to create a newStorageFileProviderinstance with default values provided byStorageFileProvider.Defaults.static StorageFileProviderFileProvider(File storageDirectory)Deprecated.static StorageFileProviderFileProvider(Path storageDirectory)Pseudo-constructor method to create a newStorageFileProviderinstance with the passed file as the storage directory and defaults provided byStorageFileProvider.Defaults.static StorageFileProvider.Builder<?>FileProviderBuilder()Pseudo-constructor method to create a newStorageFileProvider.Builderinstance.static StorageHousekeepingControllerHousekeepingController()Pseudo-constructor method to create a newStorageHousekeepingControllerinstance using default values defined byStorageHousekeepingController.Defaults.static StorageHousekeepingControllerHousekeepingController(long housekeepingIntervalMs, long housekeepingTimeBudgetNs)Pseudo-constructor method to create a newStorageHousekeepingControllerinstance using the passed values.static booleanisDataFile(StorageNumberedFile file)Checks if the passedStorageNumberedFileis a storage data file.static booleanisTransactionFile(StorageNumberedFile file)Checks if the passedStorageNumberedFileis a transaction file by comparing its file number totransactionsFileNumber().static StorageLockFileSetup.ProviderLockFileSetupProvider()Pseudo-constructor method to create a newStorageLockFileSetup.Providerinstance using default values specified byStorageLockFileSetup.Defaults.static StorageLockFileSetup.ProviderLockFileSetupProvider(long updateInterval)Pseudo-constructor method to create a newStorageLockFileSetup.Providerinstance using the passed values and default values specified byStorageLockFileSetup.Defaults.static StorageLockFileSetup.ProviderLockFileSetupProvider(Charset charset)Pseudo-constructor method to create a newStorageLockFileSetup.Providerinstance using the passed values and default values specified byStorageLockFileSetup.Defaults.static StorageLockFileSetup.ProviderLockFileSetupProvider(Charset charset, long updateInterval)Pseudo-constructor method to create a newProviderinstance using the passed values.static longtransactionsFileNumber()Returns the dummy file number for transaction files, which is the value .
-
-
-
Method Detail
-
transactionsFileNumber
public static final long transactionsFileNumber()
Returns the dummy file number for transaction files, which is the value .Transaction files conceptually don't have a file number, but are subject to the
StorageNumberedFiletype, so a dummy value is required. Since transaction files are planned to be replaced in the future by meta data inlined directly in the storage files, a dummy value like this is a preferable solution to an elaborate restructuring.- Returns:
- the dummy file number for transaction files.
-
isTransactionFile
public static final boolean isTransactionFile(StorageNumberedFile file)
Checks if the passedStorageNumberedFileis a transaction file by comparing its file number totransactionsFileNumber().- Parameters:
file- theStorageNumberedFileto be checked.- Returns:
- whether the passed file is a transactions file.
- See Also:
transactionsFileNumber(),isDataFile(StorageNumberedFile)
-
isDataFile
public static final boolean isDataFile(StorageNumberedFile file)
Checks if the passedStorageNumberedFileis a storage data file.- Parameters:
file- theStorageNumberedFileto be checked.- Returns:
- whether the passed file is a storage data file.
- See Also:
isTransactionFile(StorageNumberedFile)
-
FileProvider
public static final StorageFileProvider FileProvider()
Pseudo-constructor method to create a newStorageFileProviderinstance with default values provided byStorageFileProvider.Defaults.For explanations and customizing values, see
StorageFileProvider.Builder.- Returns:
- See Also:
FileProvider(Path),StorageFileProvider.New(),StorageFileProvider.Builder,StorageFileProvider.Defaults
-
FileProvider
@Deprecated public static final StorageFileProvider FileProvider(File storageDirectory)
Deprecated.Alias forFileProvider(storageDirectory.toPath())- Parameters:
storageDirectory- the directory where the storage will be located.- Returns:
- a new
StorageFileProviderinstance. - See Also:
FileProvider(Path)
-
FileProvider
public static final StorageFileProvider FileProvider(Path storageDirectory)
Pseudo-constructor method to create a newStorageFileProviderinstance with the passed file as the storage directory and defaults provided byStorageFileProvider.Defaults.For explanations and customizing values, see
StorageFileProvider.Builder.- Parameters:
storageDirectory- the directory where the storage will be located.- Returns:
- a new
StorageFileProviderinstance. - See Also:
FileProvider(),StorageFileProvider.New(Path),StorageFileProvider.Builder,StorageFileProvider.Defaults
-
FileProviderBuilder
public static final StorageFileProvider.Builder<?> FileProviderBuilder()
Pseudo-constructor method to create a newStorageFileProvider.Builderinstance.For explanations and customizing values, see
StorageFileProvider.Builder.- Returns:
- a new
StorageFileProvider.Builderinstance. - See Also:
FileProvider(),FileProvider(Path),StorageFileProvider.Builder
-
Configuration
public static final StorageConfiguration Configuration()
Pseudo-constructor method to create a newStorageConfigurationinstance usingnullas theStorageBackupSetuppart and default instances for everything else.For explanations and customizing values, see
StorageConfiguration.Builder.- Returns:
- a new
StorageConfigurationinstance. - See Also:
Configuration(StorageFileProvider),StorageConfiguration.New(),StorageConfiguration.Builder
-
Configuration
public static final StorageConfiguration Configuration(StorageFileProvider fileProvider)
Pseudo-constructor method to create a newStorageConfigurationinstance using the passedStorageFileProvider,nullas theStorageBackupSetuppart and default instances for everything else.For explanations and customizing values, see
StorageConfiguration.Builder.- Parameters:
fileProvider- theStorageFileProviderto provide directory and file names.- Returns:
- a new
StorageConfigurationinstance. - See Also:
Configuration(),StorageConfiguration.New(StorageFileProvider),StorageConfiguration.Builder
-
ConfigurationBuilder
public static final StorageConfiguration.Builder<?> ConfigurationBuilder()
Pseudo-constructor method to create a newStorageConfiguration.Builderinstance.For explanations and customizing values, see
StorageConfiguration.Builder.- Returns:
- a new
StorageConfiguration.Builderinstance. - See Also:
Configuration(),Configuration(StorageFileProvider),StorageConfiguration.Builder(),StorageConfiguration.Builder
-
HousekeepingController
public static final StorageHousekeepingController HousekeepingController()
Pseudo-constructor method to create a newStorageHousekeepingControllerinstance using default values defined byStorageHousekeepingController.Defaults.- Returns:
- a new
StorageHousekeepingControllerinstance. - See Also:
HousekeepingController(long,long),StorageHousekeepingController.New(),StorageHousekeepingController.Defaults
-
HousekeepingController
public static final StorageHousekeepingController HousekeepingController(long housekeepingIntervalMs, long housekeepingTimeBudgetNs)
Pseudo-constructor method to create a newStorageHousekeepingControllerinstance using the passed values.The combination of these two values can be used to define how much percentage of the system's computing power shall be used for storage housekeeping.
Example:
10 Million ns (= 10 ms) housekeeping budget every 1000 ms means (roughly) 1% of the computing power will be used for storage housekeeping.Note that in an application where no store occures over a longer period of time, all housekeeping tasks will eventually be completed, reducing the required computing power to 0. When the next store occurs, the housekeeping starts anew.
How long the housekeeping requires to complete depends on the computing power it is granted by theStorageHousekeepingController, other configurations (like entity data cache timeouts) and the amount of data that has to be managed.See all "issue~" methods in
StorageConnectionfor a way to call housekeeping actions explicitly and causing them to be executed completely.- Parameters:
housekeepingIntervalMs- the interval in milliseconds that the storage threads shallexecute their various housekeeping actions (like cache clearing checks, file consolidation, etc.).Must be greater than zero.housekeepingTimeBudgetNs- the time budget in nanoseconds that each storage thread will use to performa housekeeping action. This is a best effort value, not a strictly reliable border value. This meansa housekeeping action can occasionally take slightly longer than specified here.Must be greater than zero.- Returns:
- a new
StorageHousekeepingControllerinstance. - See Also:
HousekeepingController(),StorageHousekeepingController.New(long,long)
-
EntityCacheEvaluator
public static final StorageEntityCacheEvaluator EntityCacheEvaluator()
Pseudo-constructor method to create a newStorageEntityCacheEvaluatorinstance using default values defined byStorageEntityCacheEvaluator.Defaults.For explanations and customizing values, see
StorageEntityCacheEvaluator.New(long,long).- Returns:
- a new
StorageEntityCacheEvaluatorinstance.. - See Also:
EntityCacheEvaluator(long),EntityCacheEvaluator(long,long),StorageEntityCacheEvaluator.New()
-
EntityCacheEvaluator
public static final StorageEntityCacheEvaluator EntityCacheEvaluator(long timeoutMs)
Pseudo-constructor method to create a newStorageEntityCacheEvaluatorinstance using the passed value and default values defined byStorageEntityCacheEvaluator.Defaults.For explanations and customizing values, see
StorageEntityCacheEvaluator.New(long,long).- Parameters:
timeoutMs- the time (in milliseconds, greater than 0) of not being read (the "age"), after which a particularentity's data will be cleared from the Storage's internal cache.- Returns:
- a new
StorageEntityCacheEvaluatorinstance. - See Also:
EntityCacheEvaluator(),EntityCacheEvaluator(long,long),StorageEntityCacheEvaluator.New(long)
-
EntityCacheEvaluator
public static final StorageEntityCacheEvaluator EntityCacheEvaluator(long timeoutMs, long threshold)
Pseudo-constructor method to create a newStorageEntityCacheEvaluatorinstance using the passed values.In the default implementation, two values are combined to calculate an entity's "cache weight": its "age" (the time in milliseconds of not being read) and its size in bytes. The resulting value is in turn compared to an abstract "free space" value, calculated by subtracting the current total cache size in bytes from the abstract threshold value defined here. If this comparison deems the tested entity to be "too heavy" for the cache, its data is cleared from the cache. It is also cleared from the cache if its "age" is greater than the timeout defined here.
This is a relatively simple and extremely fast algorithm to create the following behavior:
- Cached data that seems to not be used currently ("too old") is cleared.
- Apart from that, as long as there is "enough space", nothing is cleared.
- The old and bigger an entity's data is, the more likely it is to be cleared.
- The less free space there is in the cache, the sooner cached entity data is cleared.
- Parameters:
timeoutMs- the time (in milliseconds, greater than 0) of not being read (the "age"), after which a particularentity's data will be cleared from the Storage's internal cache.threshold- an abstract value (greater than 0) to evaluate the product of size and age of an entity in relationto the current cache size in order to determine if the entity's data shall be cleared from the cache.- Returns:
- a new
StorageEntityCacheEvaluatorinstance. - See Also:
EntityCacheEvaluator(),EntityCacheEvaluator(long),StorageEntityCacheEvaluator.New(long,long)
-
ChannelCountProvider
public static final StorageChannelCountProvider ChannelCountProvider()
Pseudo-constructor method to create a newStorageChannelCountProviderinstance using default values defined byStorageChannelCountProvider.Defaults.For explanations and customizing values, see
StorageChannelCountProvider.New(int).- Returns:
- a new
StorageChannelCountProviderinstance. - See Also:
ChannelCountProvider(int),StorageChannelCountProvider.New()
-
ChannelCountProvider
public static final StorageChannelCountProvider ChannelCountProvider(int channelCount)
Pseudo-constructor method to create a newStorageChannelCountProviderinstance using the passed value.A "channel" is the combination of exclusive storage
Threadmaintaining an entity registry, data cache, and the like and a storage directory containing storage data files exclusively used by that thread.
The more channels there are, the more parallel loading and storing operations will be executed and the faster the application will become, provided a hardware that can effectively execute that many threads.Since channels use bitwise modulo hashing, the number of channels must always be a 2^n number with n greater than or equal 0.
(Meaning 1, 2, 4, 8, 16, etc.)- Parameters:
channelCount- the number of channels. Must be a 2^n number with n greater than or equal 0.- Returns:
- a new
StorageChannelCountProviderinstance.
-
DataFileEvaluator
public static final StorageDataFileEvaluator DataFileEvaluator()
Pseudo-constructor method to create a newStorageDataFileEvaluatorinstance using default values specified byStorageDataFileEvaluator.Defaults.For explanations and customizing values, see
StorageDataFileEvaluator.New(int,int,double).- Returns:
- a new
StorageDataFileEvaluatorinstance. - See Also:
DataFileEvaluator(int,int),DataFileEvaluator(int,int,double),StorageDataFileEvaluator.New()
-
DataFileEvaluator
public static final StorageDataFileEvaluator DataFileEvaluator(int fileMinimumSize, int fileMaximumSize)
Pseudo-constructor method to create a newStorageDataFileEvaluatorinstance using the passed values and default values specified byStorageDataFileEvaluator.Defaults.For explanations and customizing values, see
StorageDataFileEvaluator.New(int,int,double).- Parameters:
fileMinimumSize- the minimum file size in bytes that a single storage file must have. Smaller fileswill be dissolved.fileMaximumSize- the maximum file size in bytes that a single storage file may have. Larger fileswill be dissolved.
Note that a file can exceed this limit if it contains a single entity that already exceeds the limit.E.g. an int array with 10 million elements would be about 40 MB in size and would exceed a file sizelimit of, for example, 30 MB.- Returns:
- a new
StorageDataFileEvaluatorinstance. - See Also:
DataFileEvaluator(),DataFileEvaluator(int,int,double),StorageDataFileEvaluator.New(int,int)
-
DataFileEvaluator
public static final StorageDataFileEvaluator DataFileEvaluator(int fileMinimumSize, int fileMaximumSize, double minimumUseRatio)
Pseudo-constructor method to create a newStorageDataFileEvaluatorinstance using the passed values.A
StorageDataFileEvaluatoris used to evaluate storage data files regarding if they should be desolved, meaning copy all their still needed data to the current head file and then delete the file.
This technique is used to optimize (or "clean up") the occupied storage space: No longer needed data, e.g. of entities that became unreachable or prior versions of a still reachable entity, is considered a logical "gap", that occupies storage space unnecessarily. These "gaps" have to be removed in order to only occupy as much storage space as required.The parameters defined here give an opportunity to configure how "aggressive" this clean up shall be performaned. The trade-off is between acceptale gap sizes and the required performance and disk-writes to clean them up.
Without specifying them, default values will be used, defined inStorageDataFileEvaluator.Defaults.- Parameters:
fileMinimumSize- the minimum file size in bytes that a single storage file must have. Smaller fileswill be dissolved.fileMaximumSize- the maximum file size in bytes that a single storage file may have. Larger fileswill be dissolved.
Note that a file can exceed this limit if it contains a single entity that already exceeds the limit.E.g. an int array with 10 million elements would be about 40 MB in size and would exceed a file sizelimit of, for example, 30 MB.- Returns:
- a new
StorageDataFileEvaluatorinstance. - See Also:
DataFileEvaluator(),DataFileEvaluator(int,int),StorageDataFileEvaluator.New(int,int,double)
-
DataFileEvaluator
public static final StorageDataFileEvaluator DataFileEvaluator(int fileMinimumSize, int fileMaximumSize, double minimumUseRatio, boolean cleanUpHeadFile)
Pseudo-constructor method to create a newStorageDataFileEvaluatorinstance using the passed values and default values specified byStorageDataFileEvaluator.Defaults.For explanations and customizing values, see
StorageDataFileEvaluator.New(int,int,double).- Parameters:
fileMinimumSize- the minimum file size in bytes that a single storage file must have. Smaller fileswill be dissolved.fileMaximumSize- the maximum file size in bytes that a single storage file may have. Larger fileswill be dissolved.
Note that a file can exceed this limit if it contains a single entity that already exceeds the limit.E.g. an int array with 10 million elements would be about 40 MB in size and would exceed a file sizelimit of, for example, 30 MB.minimumUseRatio- the ratio (value in ]0.0;1.0]) of non-gap data contained in a storage file to preventthe file from being dissolved. "Gap" data is anything that is not the latest version of an entity's data,inluding older versions of an entity and "comment" bytes (a sequence of bytes beginning with its lengthas a negative value length header).
The closer this value is to 1.0 (100%), the less disk space is occupied by storage files, but the morefile dissolving (data transfers to new files) is required and vice versa.cleanUpHeadFile- a flag defining wether the current head file (the only file actively written to)shall be subjected to file cleanups as well.- Returns:
- dissolveHeadfile a new
StorageDataFileEvaluatorinstance. - See Also:
DataFileEvaluator(),DataFileEvaluator(int,int),DataFileEvaluator(int,int,double),StorageDataFileEvaluator.New(int,int,double,boolean)
-
BackupSetup
@Deprecated public static final StorageBackupSetup BackupSetup(File backupDirectory)
Deprecated.
-
BackupSetup
public static final StorageBackupSetup BackupSetup(Path backupDirectory)
- Parameters:
backupDirectory-- Returns:
- See Also:
StorageBackupSetup.New(StorageFileProvider),StorageBackupHandler
-
BackupSetup
public static final StorageBackupSetup BackupSetup(String backupDirectoryPath)
Pseudo-constructor method to create a newStorageBackupSetupinstance using the passed directory as the backup location.For explanations and customizing values, see
StorageBackupSetup.New(StorageFileProvider).- Parameters:
backupDirectoryPath- the path to the backup directory- Returns:
- See Also:
StorageBackupSetup.New(Path),StorageBackupSetup.New(StorageFileProvider),StorageBackupHandler
-
BackupSetup
public static final StorageBackupSetup BackupSetup(StorageFileProvider backupFileProvider)
Pseudo-constructor method to create a newStorageBackupSetupinstance using the passedStorageFileProvider.A StorageBackupSetup basically defines where the backup files will be located by the
StorageBackupHandler.- Parameters:
backupFileProvider- theStorageFileProviderto define where the backup files will be located.- Returns:
- a new
StorageBackupSetupinstance. - See Also:
StorageBackupSetup.New(Path),StorageBackupHandler
-
LockFileSetupProvider
public static StorageLockFileSetup.Provider LockFileSetupProvider()
Pseudo-constructor method to create a newStorageLockFileSetup.Providerinstance using default values specified byStorageLockFileSetup.Defaults.For explanations and customizing values, see {@link StorageLockFileSetup.Provider(Charset, long)}.
- Returns:
- a new
Providerinstance. - See Also:
StorageLockFileSetup,LockFileSetupProvider(Charset),LockFileSetupProvider(long),LockFileSetupProvider(Charset,long)
-
LockFileSetupProvider
public static StorageLockFileSetup.Provider LockFileSetupProvider(Charset charset)
Pseudo-constructor method to create a newStorageLockFileSetup.Providerinstance using the passed values and default values specified byStorageLockFileSetup.Defaults.For explanations and customizing values, see
StorageLockFileSetup.Provider(Charset,long).- Parameters:
charset- theCharsetto be used for the lock file content.- Returns:
- a new
Providerinstance. - See Also:
StorageLockFileSetup,LockFileSetupProvider(),LockFileSetupProvider(long),LockFileSetupProvider(Charset,long)
-
LockFileSetupProvider
public static StorageLockFileSetup.Provider LockFileSetupProvider(long updateInterval)
Pseudo-constructor method to create a newStorageLockFileSetup.Providerinstance using the passed values and default values specified byStorageLockFileSetup.Defaults.For explanations and customizing values, see
StorageLockFileSetup.Provider(Charset,long).- Parameters:
updateInterval- the update interval in ms.- Returns:
- a new
Providerinstance. - See Also:
StorageLockFileSetup,LockFileSetupProvider(),LockFileSetupProvider(Charset),LockFileSetupProvider(Charset,long)
-
LockFileSetupProvider
public static StorageLockFileSetup.Provider LockFileSetupProvider(Charset charset, long updateInterval)
Pseudo-constructor method to create a newProviderinstance using the passed values.A
Providerinstance created by this method provides newStorageLockFileSetupinstances that use the passed Charset and updateInterval.- Parameters:
charset- theCharsetto be used for the lock file content.updateInterval- the update interval in ms.- Returns:
- a new
Providerinstance. - See Also:
StorageLockFileSetup,LockFileSetupProvider(),LockFileSetupProvider(Charset),LockFileSetupProvider(long)
-
consolidate
public static final <C extends StorageConnection> C consolidate(C storageConnection, StorageDataFileDissolvingEvaluator fileDissolver, StorageEntityCacheEvaluator entityEvaluator)
Consolidates the storage system represented by the passedStorageConnectionby callingStorageConnection.issueFullGarbageCollection()
StorageConnection.issueFullFileCheck(StorageDataFileDissolvingEvaluator)
StorageConnection.issueFullCacheCheck(StorageEntityCacheEvaluator)
in that order.Depending on the passed functions, this call can do anything from cleaning/optimizing the storage a little to fully reorganize/optimize the storage files, clear the complete cache and making the storage virtually dormant until the next store.
- Parameters:
storageConnection- The connection to the storage that shall be consolidated.fileDissolver- The function evaluating whether to dissolve a file.
May be null to indicate the use of the live configuration as a default.entityEvaluator- The function evaluating whether to clear an entity from the cache.
May be null to indicate the use of the live configuration as a default.- Returns:
- the passed storageConnection instance.
-
consolidate
public static final <C extends StorageConnection> C consolidate(C storageConnection)
Callsconsolidate(StorageConnection,StorageDataFileDissolvingEvaluator,StorageEntityCacheEvaluator)with null as additional parameters (causing live configuration to be used instead).- Parameters:
storageConnection- The connection to the storage that shall be consolidated.- Returns:
- the passed storageConnection instance.
-
consolidate
public static final <C extends StorageConnection> C consolidate(C storageConnection, StorageDataFileDissolvingEvaluator fileDissolver)
Callsconsolidate(StorageConnection,StorageDataFileDissolvingEvaluator,StorageEntityCacheEvaluator)with null as additional parameters (causing live configuration to be used instead).- Parameters:
storageConnection- The connection to the storage that shall be consolidated.fileDissolver- The function evaluating whether to dissolve a file.
May be null to indicate the use of the live configuration as a default.- Returns:
- the passed storageConnection instance.
-
consolidate
public static final <C extends StorageConnection> C consolidate(C storageConnection, StorageEntityCacheEvaluator entityEvaluator)
Callsconsolidate(StorageConnection,StorageDataFileDissolvingEvaluator,StorageEntityCacheEvaluator)with null as additional parameters (causing live configuration to be used instead).- Parameters:
storageConnection- The connection to the storage that shall be consolidated.entityEvaluator- The function evaluating whether to clear an entity from the cache.
May be null to indicate the use of the live configuration as a default.- Returns:
- the passed storageConnection instance.
-
-