Interface EmbeddedStorageConfigurationBuilder
- All Superinterfaces:
Configuration.Builder
- All Known Implementing Classes:
EmbeddedStorageConfigurationBuilder.Default
public interface EmbeddedStorageConfigurationBuilder extends Configuration.Builder
A specialized
Configuration.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 class
EmbeddedStorageConfigurationBuilder.Default
-
Method Summary
Modifier and Type Method Description default EmbeddedStorageFoundation<?>
createEmbeddedStorageFoundation()
Creates anEmbeddedStorageFoundation
based on the settings of this builder.static EmbeddedStorageConfigurationBuilder
New()
Pseude-constructor method to create a new builder.static EmbeddedStorageConfigurationBuilder
New(Configuration.Builder delegate)
Pseude-constructor method to create a new builder, wrapping an existing one.EmbeddedStorageConfigurationBuilder
setBackupDirectory(String backupDirectory)
The backup directory.default EmbeddedStorageConfigurationBuilder
setBackupDirectoryInUserHome(String backupDirectoryInUserHome)
The backup directory.EmbeddedStorageConfigurationBuilder
setChannelCount(int channelCount)
The number of threads and number of directories used by the storage engine.EmbeddedStorageConfigurationBuilder
setChannelDirectoryPrefix(String channelDirectoryPrefix)
Name prefix of the subdirectories used by the channel threads.EmbeddedStorageConfigurationBuilder
setDataFileCleanupHeadFile(boolean dataFileCleanupHeadFile)
A flag defining wether the current head file (the only file actively written to) shall be subjected to file cleanups as well.EmbeddedStorageConfigurationBuilder
setDataFileMaximumSize(ByteSize dataFileMaximumSize)
Maximum file size for a data file to avoid cleaning it up.EmbeddedStorageConfigurationBuilder
setDataFileMinimumSize(ByteSize dataFileMinimumSize)
Minimum file size for a data file to avoid cleaning it up.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.EmbeddedStorageConfigurationBuilder
setDataFilePrefix(String dataFilePrefix)
Name prefix of the storage files.EmbeddedStorageConfigurationBuilder
setDataFileSuffix(String dataFileSuffix)
Name suffix of the storage files.EmbeddedStorageConfigurationBuilder
setDeletionDirectory(String deletionDirectory)
The deletion directory.EmbeddedStorageConfigurationBuilder
setEntityCacheThreshold(long entityCacheThreshold)
Abstract threshold value for the lifetime of entities in the cache.EmbeddedStorageConfigurationBuilder
setEntityCacheTimeout(Duration entityCacheTimeout)
Timeout for the entity cache evaluator.EmbeddedStorageConfigurationBuilder
setHousekeepingInterval(Duration housekeepingInterval)
Interval for the houskeeping.EmbeddedStorageConfigurationBuilder
setHousekeepingTimeBudget(Duration housekeepingTimeBudget)
Duration used for each housekeeping cycle.EmbeddedStorageConfigurationBuilder
setLockFileName(String lockFileName)
EmbeddedStorageConfigurationBuilder
setRescuedFileSuffix(String rescuedFileSuffix)
EmbeddedStorageConfigurationBuilder
setStorageDirectory(String storageDirectory)
The base directory of the storage in the file system.default EmbeddedStorageConfigurationBuilder
setStorageDirectoryInUserHome(String storageDirectoryInUserHome)
The base directory of the storage in the file system.EmbeddedStorageConfigurationBuilder
setTransactionFilePrefix(String transactionFilePrefix)
Name prefix of the storage transaction file.EmbeddedStorageConfigurationBuilder
setTransactionFileSuffix(String transactionFileSuffix)
Name suffix of the storage transaction file.EmbeddedStorageConfigurationBuilder
setTruncationDirectory(String truncationDirectory)
The truncation directory.EmbeddedStorageConfigurationBuilder
setTypeDictionaryFileName(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 Details
-
setStorageDirectory
The base directory of the storage in the file system. -
setStorageDirectoryInUserHome
default EmbeddedStorageConfigurationBuilder setStorageDirectoryInUserHome(String storageDirectoryInUserHome)The base directory of the storage in the file system. relative location in the user home directory- Parameters:
storageDirectoryInUserHome
-
-
setDeletionDirectory
The deletion directory. -
setTruncationDirectory
The truncation directory. -
setBackupDirectory
The backup directory. -
setBackupDirectoryInUserHome
default EmbeddedStorageConfigurationBuilder setBackupDirectoryInUserHome(String backupDirectoryInUserHome)The backup directory.- Parameters:
backupDirectoryInUserHome
- relative location in the user home directory
-
setChannelCount
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
-
setChannelDirectoryPrefix
Name prefix of the subdirectories used by the channel threads. Default is"channel_"
.- Parameters:
channelDirectoryPrefix
- new prefix
-
setDataFilePrefix
Name prefix of the storage files. Default is"channel_"
.- Parameters:
dataFilePrefix
- new prefix
-
setDataFileSuffix
Name suffix of the storage files. Default is".dat"
.- Parameters:
dataFileSuffix
- new suffix
-
setTransactionFilePrefix
Name prefix of the storage transaction file. Default is"transactions_"
.- Parameters:
transactionFilePrefix
- new prefix
-
setTransactionFileSuffix
Name suffix of the storage transaction file. Default is".sft"
.- Parameters:
transactionFileSuffix
- new suffix
-
setTypeDictionaryFileName
The name of the dictionary file. Default is"PersistenceTypeDictionary.ptd"
.- Parameters:
typeDictionaryFileName
- new name
-
setRescuedFileSuffix
-
setLockFileName
-
setHousekeepingInterval
Interval for the houskeeping. 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- See Also:
setHousekeepingTimeBudget(Duration)
-
setHousekeepingTimeBudget
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- See Also:
setHousekeepingInterval(Duration)
-
setEntityCacheThreshold
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- See Also:
setEntityCacheTimeout(Duration)
-
setEntityCacheTimeout
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- See Also:
Duration
,setEntityCacheThreshold(long)
-
setDataFileMinimumSize
Minimum file size for a data file to avoid cleaning it up. Default is 1 MiB.- Parameters:
dataFileMinimumSize
- the new minimum file size- See Also:
setDataFileMinimumUseRatio(double)
-
setDataFileMaximumSize
Maximum file size for a data file to avoid cleaning it up. Default is 8 MiB.- Parameters:
dataFileMaximumSize
- the new maximum file size- See Also:
setDataFileMinimumUseRatio(double)
-
setDataFileMinimumUseRatio
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).
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
-
setDataFileCleanupHeadFile
A flag defining wether the current head file (the only file actively written to) shall be subjected to file cleanups as well.- Parameters:
dataFileCleanupHeadFile
-
-
createEmbeddedStorageFoundation
Creates anEmbeddedStorageFoundation
based on the settings of this builder.- Returns:
- an
EmbeddedStorageFoundation
- See Also:
EmbeddedStorageFoundationCreatorConfigurationBased
-
New
Pseude-constructor method to create a new builder.- Returns:
- a new
EmbeddedStorageConfigurationBuilder
-
New
Pseude-constructor method to create a new builder, wrapping an existing one.- Parameters:
delegate
- the delegate to wrap- Returns:
- a new
EmbeddedStorageConfigurationBuilder
-