Class EmbeddedStorageManagerBuilder
java.lang.Object
io.helidon.integrations.microstream.core.EmbeddedStorageManagerBuilder
- All Implemented Interfaces:
Builder<EmbeddedStorageManagerBuilder,
,one.microstream.storage.embedded.types.EmbeddedStorageManager> Supplier<one.microstream.storage.embedded.types.EmbeddedStorageManager>
public class EmbeddedStorageManagerBuilder
extends Object
implements Builder<EmbeddedStorageManagerBuilder,one.microstream.storage.embedded.types.EmbeddedStorageManager>
Builder for Microstream EmbeddedStorageManager.
-
Method Summary
Modifier and TypeMethodDescriptionbackupDirectory
(String backupDirectory) The backup directory.one.microstream.storage.embedded.types.EmbeddedStorageManager
build()
Build the instance from this builder.builder()
A builder for the EmbeddedStorageManager.channelCount
(int channelCount) The number of threads and number of directories used by the storage engine.channelDirectoryPrefix
(String channelDirectoryPrefix) Name prefix of the subdirectories used by the channel threads.Update builder from configuration.static one.microstream.storage.embedded.types.EmbeddedStorageManager
Create a EmbeddedStorageManager instance from Config.dataFileCleanupHeadFile
(boolean dataFileCleanupHeadFile) A flag defining whether the current head file (the only file actively written to) shall be subjected to file cleanups as well.dataFileMaximumSize
(one.microstream.configuration.types.ByteSize dataFileMaximumSize) Maximum file size for a data file to avoid cleaning it up.dataFileMinimumSize
(one.microstream.configuration.types.ByteSize dataFileMinimumSize) Minimum file size for a data file to avoid cleaning it up.dataFileMinimumUseRatio
(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.dataFilePrefix
(String dataFilePrefix) Name prefix of the storage files.dataFileSuffix
(String dataFileSuffix) Name suffix of the storage files.deletionDirectory
(String deletionDirectory) The deletion directory.entityCacheThreshold
(long entityCacheThreshold) Abstract threshold value for the lifetime of entities in the cache.entityCacheTimeout
(Duration entityCacheTimeout) Timeout in milliseconds for the entity cache evaluator.housekeepingInterval
(Duration housekeepingInterval) Interval in milliseconds for the housekeeping.housekeepingTimeBudget
(Duration housekeepingTimeBudget) Number of nanoseconds used for each housekeeping cycle.lockFileName
(String lockFileName) Name of the lock file.rescuedFileSuffix
(String rescuedFileSuffix) Name suffix of the storage rescue files.storageDirectory
(String storageDirectory) The base directory of the storage in the file system.transactionFilePrefix
(String transactionFilePrefix) Name prefix of the storage transaction file.transactionFileSuffix
(String transactionFileSuffix) Name suffix of the storage transaction file.truncationDirectory
(String truncationDirectory) The truncation directory.typeDictionaryFilename
(String typeDictionaryFilename) The name of the dictionary file.
-
Method Details
-
builder
A builder for the EmbeddedStorageManager.- Returns:
- a new fluent API builder
-
create
Create a EmbeddedStorageManager instance from Config.- Parameters:
config
- configuration to use- Returns:
- new EmbeddedStorageManager instance
-
build
public one.microstream.storage.embedded.types.EmbeddedStorageManager build()Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<EmbeddedStorageManagerBuilder,
one.microstream.storage.embedded.types.EmbeddedStorageManager> - Returns:
- instance of the built type
-
config
Update builder from configuration.- Parameters:
config
-- Returns:
- the fluent API builder
-
storageDirectory
The base directory of the storage in the file system.- Parameters:
storageDirectory
- location of the storage as string.- Returns:
- EmbeddedStorageManager builder
-
backupDirectory
The backup directory.- Parameters:
backupDirectory
- location of the storage backup as string.- Returns:
- EmbeddedStorageManager builder
-
deletionDirectory
The deletion directory.- Parameters:
deletionDirectory
- location of the storage's deleted files backup as string.- Returns:
- EmbeddedStorageManager builder
-
truncationDirectory
The truncation directory.- Parameters:
truncationDirectory
- location of the storage's truncation files backup as string.- Returns:
- EmbeddedStorageManager builder
-
channelDirectoryPrefix
Name prefix of the subdirectories used by the channel threads. Default is"channel_"
.- Parameters:
channelDirectoryPrefix
- new prefix- Returns:
- EmbeddedStorageManager builder
-
dataFilePrefix
Name prefix of the storage files. Default is"channel_"
.- Parameters:
dataFilePrefix
- new prefix- Returns:
- EmbeddedStorageManager builder
-
dataFileSuffix
Name suffix of the storage files. Default is".dat"
.- Parameters:
dataFileSuffix
- new suffix- Returns:
- EmbeddedStorageManager builder
-
transactionFilePrefix
Name prefix of the storage transaction file. Default is"transactions_"
.- Parameters:
transactionFilePrefix
- new prefix- Returns:
- EmbeddedStorageManager builder
-
transactionFileSuffix
Name suffix of the storage transaction file. Default is".sft"
.- Parameters:
transactionFileSuffix
- new suffix- Returns:
- EmbeddedStorageManager builder
-
typeDictionaryFilename
The name of the dictionary file. Default is"PersistenceTypeDictionary.ptd"
.- Parameters:
typeDictionaryFilename
- new name- Returns:
- EmbeddedStorageManager builder
-
rescuedFileSuffix
Name suffix of the storage rescue files. Default is ".bak".- Parameters:
rescuedFileSuffix
-- Returns:
- EmbeddedStorageManager builder
-
lockFileName
Name of the lock file. Default is "used.lock"- Parameters:
lockFileName
-- Returns:
- EmbeddedStorageManager builder
-
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:
- EmbeddedStorageManager builder
-
housekeepingInterval
Interval in milliseconds for the housekeeping. This is work like garbage collection or cache checking. In combination withhousekeepingTimeBudget(Duration)
the maximum processor time for housekeeping work can be set. Default is1000
(every second).- Parameters:
housekeepingInterval
- the new interval- Returns:
- EmbeddedStorageManager builder
- See Also:
-
housekeepingTimeBudget
Number of nanoseconds 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 is10000000
(10 million nanoseconds = 10 milliseconds = 0.01 seconds).- Parameters:
housekeepingTimeBudget
- the new time budget- Returns:
- EmbeddedStorageManager builder
- See Also:
-
entityCacheTimeout
Timeout in milliseconds for the entity cache evaluator. If an entity wasn't accessed in this timespan it will be removed from the cache. Default is86400000
(1 day).- Parameters:
entityCacheTimeout
-- Returns:
- EmbeddedStorageManager builder
- See Also:
-
entityCacheThreshold
Abstract threshold value for the lifetime of entities in the cache. SeeStorageEntityCacheEvaluator
. Default is1000000000
.- Parameters:
entityCacheThreshold
- the new threshold- Returns:
- EmbeddedStorageManager builder
-
dataFileMinimumSize
public EmbeddedStorageManagerBuilder dataFileMinimumSize(one.microstream.configuration.types.ByteSize dataFileMinimumSize) Minimum file size for a data file to avoid cleaning it up. Default is 1024^2 = 1 MiB.- Parameters:
dataFileMinimumSize
- the new minimum file size- Returns:
- EmbeddedStorageManager builder
- See Also:
-
dataFileMaximumSize
public EmbeddedStorageManagerBuilder dataFileMaximumSize(one.microstream.configuration.types.ByteSize dataFileMaximumSize) Maximum file size for a data file to avoid cleaning it up. Default is 1024^2*8 = 8 MiB.- Parameters:
dataFileMaximumSize
- the new maximum file size- Returns:
- EmbeddedStorageManager builder
- See Also:
-
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:
- EmbeddedStorageManager builder
-
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
-- Returns:
- EmbeddedStorageManager builder
-