Interface EmbeddedStorageConfigurationBuilder
-
- All Superinterfaces:
Configuration.Builder
- All Known Implementing Classes:
EmbeddedStorageConfigurationBuilder.Default
public interface EmbeddedStorageConfigurationBuilder extends Configuration.Builder
A specializedConfiguration.Builder, containing setter methods for properties used in storage configurations.Use
createEmbeddedStorageFoundation()as a shortcut to create a storage foundation and finally a storage manager:EmbeddedStorageManager storage = EmbeddedStorageConfigurationBuilder.New() .setChannelCount(4) .setStorageDirectory("/path/to/storage/") .createEmbeddedStorageFoundation() .start();Or load a configuration from an external source:EmbeddedStorageManager storage = EmbeddedStorageConfiguration.load() .createEmbeddedStorageFoundation() .start();- Since:
- 05.00.00
- See Also:
EmbeddedStorageConfiguration,EmbeddedStorageConfigurationPropertyNames
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classEmbeddedStorageConfigurationBuilder.Default
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default EmbeddedStorageFoundation<?>createEmbeddedStorageFoundation()Creates anEmbeddedStorageFoundationbased on the settings of this builder.static EmbeddedStorageConfigurationBuilderNew()Pseudo-constructor method to create a new builder.static EmbeddedStorageConfigurationBuilderNew(Configuration.Builder delegate)Pseudo-constructor method to create a new builder, wrapping an existing one.EmbeddedStorageConfigurationBuildersetBackupDirectory(String backupDirectory)The backup directory.default EmbeddedStorageConfigurationBuildersetBackupDirectoryInUserHome(String backupDirectoryInUserHome)The backup directory.EmbeddedStorageConfigurationBuildersetChannelCount(int channelCount)The number of threads and number of directories used by the storage engine.EmbeddedStorageConfigurationBuildersetChannelDirectoryPrefix(String channelDirectoryPrefix)Name prefix of the subdirectories used by the channel threads.EmbeddedStorageConfigurationBuildersetDataFileCleanupHeadFile(boolean dataFileCleanupHeadFile)A flag defining whether the current head file (the only file actively written to) shall be subjected to file cleanups as well.EmbeddedStorageConfigurationBuildersetDataFileMaximumSize(ByteSize dataFileMaximumSize)Maximum file size for a data file to avoid cleaning it up.EmbeddedStorageConfigurationBuildersetDataFileMinimumSize(ByteSize dataFileMinimumSize)Minimum file size for a data file to avoid cleaning it up.EmbeddedStorageConfigurationBuildersetDataFileMinimumUseRatio(double dataFileMinimumUseRatio)The ratio (value in ]0.0;1.0]) of non-gap data contained in a storage file to prevent the file from being dissolved.EmbeddedStorageConfigurationBuildersetDataFilePrefix(String dataFilePrefix)Name prefix of the storage files.EmbeddedStorageConfigurationBuildersetDataFileSuffix(String dataFileSuffix)Name suffix of the storage files.EmbeddedStorageConfigurationBuildersetDeletionDirectory(String deletionDirectory)The deletion directory.EmbeddedStorageConfigurationBuildersetEntityCacheThreshold(long entityCacheThreshold)Abstract threshold value for the lifetime of entities in the cache.EmbeddedStorageConfigurationBuildersetEntityCacheTimeout(Duration entityCacheTimeout)Timeout for the entity cache evaluator.EmbeddedStorageConfigurationBuildersetHousekeepingInterval(Duration housekeepingInterval)Interval for the housekeeping.EmbeddedStorageConfigurationBuildersetHousekeepingTimeBudget(Duration housekeepingTimeBudget)Duration used for each housekeeping cycle.EmbeddedStorageConfigurationBuildersetLockFileName(String lockFileName)EmbeddedStorageConfigurationBuildersetRescuedFileSuffix(String rescuedFileSuffix)EmbeddedStorageConfigurationBuildersetStorageDirectory(String storageDirectory)The base directory of the storage in the file system.default EmbeddedStorageConfigurationBuildersetStorageDirectoryInUserHome(String storageDirectoryInUserHome)The base directory of the storage in the file system.EmbeddedStorageConfigurationBuildersetTransactionFilePrefix(String transactionFilePrefix)Name prefix of the storage transaction file.EmbeddedStorageConfigurationBuildersetTransactionFileSuffix(String transactionFileSuffix)Name suffix of the storage transaction file.EmbeddedStorageConfigurationBuildersetTruncationDirectory(String truncationDirectory)The truncation directory.EmbeddedStorageConfigurationBuildersetTypeDictionaryFileName(String typeDictionaryFileName)The name of the dictionary file.-
Methods inherited from interface one.microstream.configuration.types.Configuration.Builder
buildConfiguration, child, child, load, map, set, setAll, setAll, valueMapperProvider
-
-
-
-
Method Detail
-
setStorageDirectory
EmbeddedStorageConfigurationBuilder setStorageDirectory(String storageDirectory)
The base directory of the storage in the file system.- Parameters:
storageDirectory- the storage directory- Returns:
- this
-
setStorageDirectoryInUserHome
default EmbeddedStorageConfigurationBuilder setStorageDirectoryInUserHome(String storageDirectoryInUserHome)
The base directory of the storage in the file system.- Parameters:
storageDirectoryInUserHome- relative location in the user home directory- Returns:
- this
-
setDeletionDirectory
EmbeddedStorageConfigurationBuilder setDeletionDirectory(String deletionDirectory)
The deletion directory.- Parameters:
deletionDirectory- the deletion directory- Returns:
- this
-
setTruncationDirectory
EmbeddedStorageConfigurationBuilder setTruncationDirectory(String truncationDirectory)
The truncation directory.- Parameters:
truncationDirectory- the trunctation directory- Returns:
- this
-
setBackupDirectory
EmbeddedStorageConfigurationBuilder setBackupDirectory(String backupDirectory)
The backup directory.- Parameters:
backupDirectory- the backup directory- Returns:
- this
-
setBackupDirectoryInUserHome
default EmbeddedStorageConfigurationBuilder setBackupDirectoryInUserHome(String backupDirectoryInUserHome)
The backup directory.- Parameters:
backupDirectoryInUserHome- relative location in the user home directory- Returns:
- this
-
setChannelCount
EmbeddedStorageConfigurationBuilder setChannelCount(int channelCount)
The number of threads and number of directories used by the storage engine. Every thread has exclusive access to its directory. Default is1.- Parameters:
channelCount- the new channel count, must be a power of 2- Returns:
- this
-
setChannelDirectoryPrefix
EmbeddedStorageConfigurationBuilder setChannelDirectoryPrefix(String channelDirectoryPrefix)
Name prefix of the subdirectories used by the channel threads. Default is"channel_".- Parameters:
channelDirectoryPrefix- new prefix- Returns:
- this
-
setDataFilePrefix
EmbeddedStorageConfigurationBuilder setDataFilePrefix(String dataFilePrefix)
Name prefix of the storage files. Default is"channel_".- Parameters:
dataFilePrefix- new prefix- Returns:
- this
-
setDataFileSuffix
EmbeddedStorageConfigurationBuilder setDataFileSuffix(String dataFileSuffix)
Name suffix of the storage files. Default is".dat".- Parameters:
dataFileSuffix- new suffix- Returns:
- this
-
setTransactionFilePrefix
EmbeddedStorageConfigurationBuilder setTransactionFilePrefix(String transactionFilePrefix)
Name prefix of the storage transaction file. Default is"transactions_".- Parameters:
transactionFilePrefix- new prefix- Returns:
- this
-
setTransactionFileSuffix
EmbeddedStorageConfigurationBuilder setTransactionFileSuffix(String transactionFileSuffix)
Name suffix of the storage transaction file. Default is".sft".- Parameters:
transactionFileSuffix- new suffix- Returns:
- this
-
setTypeDictionaryFileName
EmbeddedStorageConfigurationBuilder setTypeDictionaryFileName(String typeDictionaryFileName)
The name of the dictionary file. Default is"PersistenceTypeDictionary.ptd".- Parameters:
typeDictionaryFileName- new name- Returns:
- this
-
setRescuedFileSuffix
EmbeddedStorageConfigurationBuilder setRescuedFileSuffix(String rescuedFileSuffix)
-
setLockFileName
EmbeddedStorageConfigurationBuilder setLockFileName(String lockFileName)
-
setHousekeepingInterval
EmbeddedStorageConfigurationBuilder setHousekeepingInterval(Duration housekeepingInterval)
Interval for the housekeeping. This is work like garbage collection or cache checking. In combination withsetHousekeepingTimeBudget(Duration)the maximum processor time for housekeeping work can be set. Default is one second.- Parameters:
housekeepingInterval- the new interval- Returns:
- this
- See Also:
setHousekeepingTimeBudget(Duration)
-
setHousekeepingTimeBudget
EmbeddedStorageConfigurationBuilder setHousekeepingTimeBudget(Duration housekeepingTimeBudget)
Duration used for each housekeeping cycle. However, no matter how low the number is, one item of work will always be completed. But if there is nothing to clean up, no processor time will be wasted. Default is 10 milliseconds = 0.01 seconds.- Parameters:
housekeepingTimeBudget- the new time budget- Returns:
- this
- See Also:
setHousekeepingInterval(Duration)
-
setEntityCacheThreshold
EmbeddedStorageConfigurationBuilder setEntityCacheThreshold(long entityCacheThreshold)
Abstract threshold value for the lifetime of entities in the cache. SeeStorageEntityCacheEvaluator.New(long, long). Default is1.000.000.000.- Parameters:
entityCacheThreshold- the new threshold- Returns:
- this
- See Also:
setEntityCacheTimeout(Duration)
-
setEntityCacheTimeout
EmbeddedStorageConfigurationBuilder setEntityCacheTimeout(Duration entityCacheTimeout)
Timeout for the entity cache evaluator. If an entity wasn't accessed in this timespan it will be removed from the cache. Default is one day. SeeStorageEntityCacheEvaluator.New(long, long).- Parameters:
entityCacheTimeout- the new timeout- Returns:
- this
- See Also:
Duration,setEntityCacheThreshold(long)
-
setDataFileMinimumSize
EmbeddedStorageConfigurationBuilder setDataFileMinimumSize(ByteSize dataFileMinimumSize)
Minimum file size for a data file to avoid cleaning it up. Default is 1 MiB.- Parameters:
dataFileMinimumSize- the new minimum file size- Returns:
- this
- See Also:
setDataFileMinimumUseRatio(double)
-
setDataFileMaximumSize
EmbeddedStorageConfigurationBuilder setDataFileMaximumSize(ByteSize dataFileMaximumSize)
Maximum file size for a data file to avoid cleaning it up. Default is 8 MiB.- Parameters:
dataFileMaximumSize- the new maximum file size- Returns:
- this
- See Also:
setDataFileMinimumUseRatio(double)
-
setDataFileMinimumUseRatio
EmbeddedStorageConfigurationBuilder setDataFileMinimumUseRatio(double dataFileMinimumUseRatio)
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, including older versions of an entity and "comment" bytes (a sequence of bytes beginning with its length as 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 more file dissolving (data transfers to new files) is required and vice versa.- Parameters:
dataFileMinimumUseRatio- the new minimum use ratio- Returns:
- this
-
setDataFileCleanupHeadFile
EmbeddedStorageConfigurationBuilder setDataFileCleanupHeadFile(boolean dataFileCleanupHeadFile)
A flag defining whether the current head file (the only file actively written to) shall be subjected to file cleanups as well.- Parameters:
dataFileCleanupHeadFile- the new clean head file- Returns:
- this
-
createEmbeddedStorageFoundation
default EmbeddedStorageFoundation<?> createEmbeddedStorageFoundation()
Creates anEmbeddedStorageFoundationbased on the settings of this builder.- Returns:
- an
EmbeddedStorageFoundation - See Also:
EmbeddedStorageFoundationCreatorConfigurationBased
-
New
static EmbeddedStorageConfigurationBuilder New()
Pseudo-constructor method to create a new builder.- Returns:
- a new
EmbeddedStorageConfigurationBuilder
-
New
static EmbeddedStorageConfigurationBuilder New(Configuration.Builder delegate)
Pseudo-constructor method to create a new builder, wrapping an existing one.- Parameters:
delegate- the delegate to wrap- Returns:
- a new
EmbeddedStorageConfigurationBuilder
-
-