public final class Storage extends Object
To setup and start a database, see the class "EmbeddedStorage".
Persistence,
StorageChannelpublic static NioFileSystem DefaultFileSystem()
public static one.microstream.afs.types.ADirectory defaultStorageDirectory()
public static one.microstream.afs.types.ADirectory defaultStorageDirectory(one.microstream.afs.types.AFileSystem fileSystem)
StorageLiveFileProvider.Defaults.defaultStorageDirectory().fileSystem - the file system to usepublic static final StorageLiveFileProvider FileProvider()
StorageLiveFileProvider.
For a detailed explanation see StorageLiveFileProvider.New().
StorageLiveFileProvider instance.FileProvider(Path),
StorageLiveFileProvider.New(),
StorageLiveFileProvider.Builder,
StorageLiveFileProvider.Defaults@Deprecated public static final StorageLiveFileProvider FileProvider(File storageDirectory)
FileProvider(Path), will be removed in version 8FileProvider(storageDirectory.toPath())storageDirectory - the directory where the storage will be located.StorageLiveFileProvider instance.public static final StorageLiveFileProvider FileProvider(Path storageDirectory)
StorageLiveFileProvider.
For a detailed explanation see StorageLiveFileProvider.New(ADirectory).
storageDirectory - the directory where the storage will be located.StorageLiveFileProvider instance.FileProvider(),
StorageLiveFileProvider.New(ADirectory),
StorageLiveFileProvider.Builder,
StorageLiveFileProvider.Defaultspublic static final StorageLiveFileProvider FileProvider(one.microstream.afs.types.ADirectory storageDirectory)
public static final StorageLiveFileProvider.Builder<?> FileProviderBuilder()
StorageLiveFileProvider.Builder.
For a detailed explanation see StorageLiveFileProvider.Builder().
StorageLiveFileProvider.Builder instance.FileProvider(),
FileProvider(Path),
StorageLiveFileProvider.Builderpublic static final StorageLiveFileProvider.Builder<?> FileProviderBuilder(one.microstream.afs.types.AFileSystem fileSystem)
StorageLiveFileProvider.Builder.
For a detailed explanation see StorageLiveFileProvider.Builder(AFileSystem).
fileSystem - the file system to useStorageLiveFileProvider.Builder instance.FileProvider(),
FileProvider(Path),
StorageLiveFileProvider.Builderpublic static final StorageBackupFileProvider BackupFileProvider()
@Deprecated public static final StorageBackupFileProvider BackupFileProvider(File storageDirectory)
public static final StorageBackupFileProvider BackupFileProvider(Path storageDirectory)
public static final StorageBackupFileProvider BackupFileProvider(one.microstream.afs.types.ADirectory storageDirectory)
public static final StorageBackupFileProvider.Builder<?> BackupFileProviderBuilder()
public static final StorageBackupFileProvider.Builder<?> BackupFileProviderBuilder(one.microstream.afs.types.AFileSystem fileSystem)
public static final StorageConfiguration Configuration()
StorageConfiguration.
For a detailed explanation see StorageConfiguration.New().
StorageConfiguration instance.Configuration(StorageLiveFileProvider),
StorageConfiguration.New(),
StorageConfiguration.Builderpublic static final StorageConfiguration Configuration(StorageLiveFileProvider fileProvider)
StorageConfiguration.
For a detailed explanation see StorageConfiguration.New(StorageLiveFileProvider).
fileProvider - the StorageLiveFileProvider to provide directory and file names.StorageConfiguration instance.Configuration(),
StorageConfiguration.New(StorageLiveFileProvider),
StorageConfiguration.Builderpublic static final StorageConfiguration.Builder<?> ConfigurationBuilder()
StorageConfiguration.Builder.
For a detailed explanation see StorageConfiguration.Builder().
StorageConfiguration.Builder instance.Configuration(),
Configuration(StorageLiveFileProvider),
StorageConfiguration.Builder(),
StorageConfiguration.Builderpublic static final StorageHousekeepingController HousekeepingController()
StorageHousekeepingController.
For a detailed explanation see StorageHousekeepingController.New().
StorageHousekeepingController instance.HousekeepingController(long, long),
StorageHousekeepingController.New(),
StorageHousekeepingController.Defaultspublic static final StorageHousekeepingController HousekeepingController(long housekeepingIntervalMs, long housekeepingTimeBudgetNs)
StorageHousekeepingController.
For a detailed explanation see StorageHousekeepingController.New(long, long).
housekeepingIntervalMs - the interval in milliseconds that the storage threads shall
execute 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 perform
a housekeeping action. This is a best effort value, not a strictly reliable border value. This means
a housekeeping action can occasionally take slightly longer than specified here.
Must be greater than zero.StorageHousekeepingController instance.HousekeepingController(),
StorageHousekeepingController.New(long, long)public static final StorageEntityCacheEvaluator EntityCacheEvaluator()
StorageEntityCacheEvaluator.
For a detailed explanation see StorageEntityCacheEvaluator.New().
StorageEntityCacheEvaluator instance.EntityCacheEvaluator(long),
EntityCacheEvaluator(long, long),
StorageEntityCacheEvaluator.New()public static final StorageEntityCacheEvaluator EntityCacheEvaluator(long timeoutMs)
StorageEntityCacheEvaluator.
For a detailed explanation see StorageEntityCacheEvaluator.New(long).
timeoutMs - the time (in milliseconds, greater than 0) of not being read (the "age"), after which a particular
entity's data will be cleared from the Storage's internal cache.StorageEntityCacheEvaluator instance.one.microstream.exceptions.NumberRangeException - if the passed value is equal to or lower than 0.EntityCacheEvaluator(),
EntityCacheEvaluator(long, long),
StorageEntityCacheEvaluator.New(long)public static final StorageEntityCacheEvaluator EntityCacheEvaluator(long timeoutMs, long threshold)
StorageEntityCacheEvaluator.
For a detailed explanation see StorageEntityCacheEvaluator.New(long, long).
timeoutMs - the time (in milliseconds, greater than 0) of not being read (the "age"), after which a particular
entity'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 relation
to the current cache size in order to determine if the entity's data shall be cleared from the cache.StorageEntityCacheEvaluator instance.one.microstream.exceptions.NumberRangeException - if any of the passed values is equal to or lower than 0.EntityCacheEvaluator(),
EntityCacheEvaluator(long),
StorageEntityCacheEvaluator.New(long, long)public static final StorageChannelCountProvider ChannelCountProvider()
StorageChannelCountProvider.
For a detailed explanation see StorageChannelCountProvider.New().
StorageChannelCountProvider instance.ChannelCountProvider(int),
StorageChannelCountProvider.New()public static final StorageChannelCountProvider ChannelCountProvider(int channelCount)
StorageChannelCountProvider.
For a detailed explanation see StorageChannelCountProvider.New(int).
channelCount - the number of channels. Must be a 2^n number with n greater than or equal 0.StorageChannelCountProvider instance.IllegalArgumentException - if the passed value is higher than the value returned by
StorageChannelCountProvider.Validation.maximumChannelCount()public static final StorageDataFileEvaluator DataFileEvaluator()
StorageDataFileEvaluator.
For a detailed explanation see StorageDataFileEvaluator.New().
StorageDataFileEvaluator instance.DataFileEvaluator(int, int),
DataFileEvaluator(int, int, double),
StorageDataFileEvaluator.New()public static final StorageDataFileEvaluator DataFileEvaluator(int fileMinimumSize, int fileMaximumSize)
StorageDataFileEvaluator.
For a detailed explanation see StorageDataFileEvaluator.New(int, int).
fileMinimumSize - the minimum file size in bytes that a single storage file must have. Smaller files
will be dissolved.fileMaximumSize - the maximum file size in bytes that a single storage file may have. Larger files
will be dissolved.StorageDataFileEvaluator instance.DataFileEvaluator(),
DataFileEvaluator(int, int, double),
StorageDataFileEvaluator.New(int, int)public static final StorageDataFileEvaluator DataFileEvaluator(int fileMinimumSize, int fileMaximumSize, double minimumUseRatio)
StorageDataFileEvaluator.
For a detailed explanation see StorageDataFileEvaluator.New(int, int, double).
fileMinimumSize - the minimum file size in bytes that a single storage file must have. Smaller files
will be dissolved.fileMaximumSize - the maximum file size in bytes that a single storage file may have. Larger files
will be dissolved.minimumUseRatio - the ratio (value in ]0.0;1.0]) of non-gap data contained in a storage file to prevent
the 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 length
as a negative value length header).StorageDataFileEvaluator instance.DataFileEvaluator(),
DataFileEvaluator(int, int),
StorageDataFileEvaluator.New(int, int, double)public static final StorageDataFileEvaluator DataFileEvaluator(int fileMinimumSize, int fileMaximumSize, double minimumUseRatio, boolean cleanUpHeadFile)
StorageDataFileEvaluator.
For a detailed explanation see StorageDataFileEvaluator.New(int, int, double, boolean).
fileMinimumSize - the minimum file size in bytes that a single storage file must have. Smaller files
will be dissolved.fileMaximumSize - the maximum file size in bytes that a single storage file may have. Larger files
will be dissolved.minimumUseRatio - the ratio (value in ]0.0;1.0]) of non-gap data contained in a storage file to prevent
the 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 length
as a negative value length header).cleanUpHeadFile - a flag defining wether the current head file (the only file actively written to)
shall be subjected to file cleanups as well.StorageDataFileEvaluator instance.DataFileEvaluator(),
DataFileEvaluator(int, int),
DataFileEvaluator(int, int, double),
StorageDataFileEvaluator.New(int, int, double, boolean)@Deprecated public static final StorageBackupSetup BackupSetup(File backupDirectory)
BackupSetup(Path), will be removed in version 8backupDirectory - the directory where the backup shall be located.StorageBackupSetup instance.public static final StorageBackupSetup BackupSetup(Path backupDirectory)
StorageBackupSetup.
For a detailed explanation see StorageBackupSetup.New(ADirectory).
backupDirectory - the directory where the backup shall be located.StorageBackupSetup instance.StorageBackupSetup.New(StorageBackupFileProvider),
StorageBackupHandlerpublic static final StorageBackupSetup BackupSetup(one.microstream.afs.types.ADirectory backupDirectory)
StorageBackupSetup.
For a detailed explanation see StorageBackupSetup.New(ADirectory).
backupDirectory - the directory where the backup shall be located.StorageBackupSetup instance.StorageBackupSetup.New(ADirectory),
StorageBackupHandlerpublic static final StorageBackupSetup BackupSetup(String backupDirectoryPath)
StorageBackupSetup.
For a detailed explanation see StorageBackupSetup.New(ADirectory).
backupDirectoryPath - the directory where the backup shall be located.StorageBackupSetup instance.StorageBackupSetup.New(ADirectory),
StorageBackupSetup.New(StorageBackupFileProvider),
StorageBackupHandlerpublic static final StorageBackupSetup BackupSetup(StorageBackupFileProvider backupFileProvider)
StorageBackupSetup.
For a detailed explanation see StorageBackupSetup.New(StorageBackupFileProvider).
backupFileProvider - the StorageBackupFileProvider to define where the backup files will be located.StorageBackupSetup instance.StorageBackupSetup.New(StorageBackupFileProvider),
StorageBackupHandlerpublic static StorageLockFileSetup.Provider LockFileSetupProvider()
StorageLockFileSetup.Provider.
For a detailed explanation see StorageLockFileSetup.Provider().
StorageLockFileSetup.Provider instance.StorageLockFileSetup,
LockFileSetupProvider(Charset),
LockFileSetupProvider(long),
LockFileSetupProvider(Charset, long)public static StorageLockFileSetup.Provider LockFileSetupProvider(Charset charset)
StorageLockFileSetup.Provider.
For a detailed explanation see StorageLockFileSetup.Provider(Charset).
charset - the Charset to be used for the lock file content.StorageLockFileSetup.Provider instance.StorageLockFileSetup,
LockFileSetupProvider(),
LockFileSetupProvider(long),
LockFileSetupProvider(Charset, long)public static StorageLockFileSetup.Provider LockFileSetupProvider(long updateInterval)
StorageLockFileSetup.Provider.
For a detailed explanation see StorageLockFileSetup.Provider(long).
updateInterval - the update interval in ms.StorageLockFileSetup.Provider instance.StorageLockFileSetup,
LockFileSetupProvider(),
LockFileSetupProvider(Charset),
LockFileSetupProvider(Charset, long)public static StorageLockFileSetup.Provider LockFileSetupProvider(Charset charset, long updateInterval)
StorageLockFileSetup.Provider.
For a detailed explanation see StorageLockFileSetup.Provider(Charset, long).
charset - the Charset to be used for the lock file content.updateInterval - the update interval in ms.StorageLockFileSetup.Provider instance.StorageLockFileSetup,
LockFileSetupProvider(),
LockFileSetupProvider(Charset),
LockFileSetupProvider(long)public static final <C extends StorageConnection> C consolidate(C storageConnection, StorageEntityCacheEvaluator entityEvaluator)
StorageConnection by callingStorageConnection.issueFullGarbageCollection()StorageConnection.issueFullFileCheck()StorageConnection.issueFullCacheCheck(StorageEntityCacheEvaluator)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.
C - the storage connection typestorageConnection - The connection to the storage that shall be consolidated.entityEvaluator - The function evaluating whether to clear an entity from the cache.public static final <C extends StorageConnection> C consolidate(C storageConnection)
consolidate(StorageConnection, StorageEntityCacheEvaluator)
with null as additional parameters (causing live configuration to be used instead).C - the storage connection typestorageConnection - The connection to the storage that shall be consolidated.Copyright © 2022 MicroStream Software. All rights reserved.