Package org.dizitart.no2.mvstore
Class MVStoreModuleBuilder
- java.lang.Object
-
- org.dizitart.no2.mvstore.MVStoreModuleBuilder
-
public class MVStoreModuleBuilder extends Object
The MVStoreModuleBuilder class is responsible for building an instance ofMVStoreModule. It provides methods to set various configuration options for the MVStore database.- Since:
- 4.0
- Author:
- Anindya Chatterjee
- See Also:
MVStoreModule
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MVStoreModuleBuilderaddStoreEventListener(StoreEventListener listener)Adds aStoreEventListenerto the module builder.booleanautoCommit()Flag to enable/disable auto-commit mode.MVStoreModuleBuilderautoCommit(boolean autoCommit)Flag to enable/disable auto-commit mode.intautoCommitBufferSize()The size of the buffer used for auto-commit.MVStoreModuleBuilderautoCommitBufferSize(int autoCommitBufferSize)The size of the buffer used for auto-commit.MVStoreModulebuild()Builds an instance ofMVStoreModulewith the configured parameters.intcacheConcurrency()The read cache concurrency used by MVStore.MVStoreModuleBuildercacheConcurrency(int cacheConcurrency)The read cache concurrency used by MVStore.intcacheSize()The size of the read cache in MB used by the MVStore.MVStoreModuleBuildercacheSize(int cacheSize)The size of the read cache in MB used by the MVStore.booleancompress()Flag to enable/disable compression of data in MVStore.MVStoreModuleBuildercompress(boolean compress)Flag to enable/disable compression of data in MVStore.booleancompressHigh()Flag to enable high compression for the MVStore.MVStoreModuleBuildercompressHigh(boolean compressHigh)Flag to enable high compression for the MVStore.MVStoreConfigdbConfig()The configuration for the MVStore.MVStoreModuleBuilderdbConfig(MVStoreConfig dbConfig)The configuration for the MVStore.char[]encryptionKey()The encryption key to be used for encrypting the MVStore.MVStoreModuleBuilderencryptionKey(char[] encryptionKey)The encryption key to be used for encrypting the MVStore.Set<StoreEventListener>eventListeners()Set of event listeners to be registered with the MVStore.StringfilePath()The file path of the MVStore file.MVStoreModuleBuilderfilePath(File file)Sets the file path for the MVStore.MVStoreModuleBuilderfilePath(String path)Sets the file path for the MVStore.org.h2.mvstore.FileStore<?>fileStore()The file store used by the MVStore.MVStoreModuleBuilderfileStore(org.h2.mvstore.FileStore<?> fileStore)The file store used by the MVStore.intpageSplitSize()The amount of memory a MVStore page should contain at most, in bytes, before it is split.MVStoreModuleBuilderpageSplitSize(int pageSplitSize)The amount of memory a MVStore page should contain at most, in bytes, before it is split.booleanreadOnly()Indicates whether the MVStore instance should be opened in read-only mode.MVStoreModuleBuilderreadOnly(boolean readOnly)Indicates whether the MVStore instance should be opened in read-only mode.booleanrecoveryMode()Indicates whether the MVStore should be opened in recovery mode or not.MVStoreModuleBuilderrecoveryMode(boolean recoveryMode)Indicates whether the MVStore should be opened in recovery mode or not.
-
-
-
Method Detail
-
filePath
public MVStoreModuleBuilder filePath(File file)
Sets the file path for the MVStore.- Parameters:
file- the file path for the MVStore.- Returns:
- the MVStoreModuleBuilder instance.
-
filePath
public MVStoreModuleBuilder filePath(String path)
Sets the file path for the MVStore.- Parameters:
path- the file path for the MVStore.- Returns:
- the MVStoreModuleBuilder instance.
-
addStoreEventListener
public MVStoreModuleBuilder addStoreEventListener(StoreEventListener listener)
Adds aStoreEventListenerto the module builder.- Parameters:
listener- the listener to be added- Returns:
- the module builder instance
-
build
public MVStoreModule build()
Builds an instance ofMVStoreModulewith the configured parameters.- Returns:
- an instance of
MVStoreModule.
-
filePath
public String filePath()
The file path of the MVStore file.
-
autoCommitBufferSize
public int autoCommitBufferSize()
The size of the buffer used for auto-commit. When the buffer is full, the changes are automatically committed to the database. The default buffer size is 1024.
-
encryptionKey
public char[] encryptionKey()
The encryption key to be used for encrypting the MVStore.
-
readOnly
public boolean readOnly()
Indicates whether the MVStore instance should be opened in read-only mode.
-
compress
public boolean compress()
Flag to enable/disable compression of data in MVStore.
-
compressHigh
public boolean compressHigh()
Flag to enable high compression for the MVStore. If set to true, the MVStore will use a higher compression level, which may result in slower read and write performance but smaller file size on disk.
-
autoCommit
public boolean autoCommit()
Flag to enable/disable auto-commit mode. If set to true, all changes will be committed immediately. If set to false, changes will be buffered and committed whenNitrite.commit()is called.
-
recoveryMode
public boolean recoveryMode()
Indicates whether the MVStore should be opened in recovery mode or not.
-
cacheSize
public int cacheSize()
The size of the read cache in MB used by the MVStore. The default value is 16MB.
-
cacheConcurrency
public int cacheConcurrency()
The read cache concurrency used by MVStore. Default is 16 segments.
-
pageSplitSize
public int pageSplitSize()
The amount of memory a MVStore page should contain at most, in bytes, before it is split. The default is 16 KB.
-
fileStore
public org.h2.mvstore.FileStore<?> fileStore()
The file store used by the MVStore.
-
dbConfig
public MVStoreConfig dbConfig()
The configuration for the MVStore.
-
eventListeners
public Set<StoreEventListener> eventListeners()
Set of event listeners to be registered with the MVStore.
-
autoCommitBufferSize
public MVStoreModuleBuilder autoCommitBufferSize(int autoCommitBufferSize)
The size of the buffer used for auto-commit. When the buffer is full, the changes are automatically committed to the database. The default buffer size is 1024.- Returns:
this.
-
encryptionKey
public MVStoreModuleBuilder encryptionKey(char[] encryptionKey)
The encryption key to be used for encrypting the MVStore.- Returns:
this.
-
readOnly
public MVStoreModuleBuilder readOnly(boolean readOnly)
Indicates whether the MVStore instance should be opened in read-only mode.- Returns:
this.
-
compress
public MVStoreModuleBuilder compress(boolean compress)
Flag to enable/disable compression of data in MVStore.- Returns:
this.
-
compressHigh
public MVStoreModuleBuilder compressHigh(boolean compressHigh)
Flag to enable high compression for the MVStore. If set to true, the MVStore will use a higher compression level, which may result in slower read and write performance but smaller file size on disk.- Returns:
this.
-
autoCommit
public MVStoreModuleBuilder autoCommit(boolean autoCommit)
Flag to enable/disable auto-commit mode. If set to true, all changes will be committed immediately. If set to false, changes will be buffered and committed whenNitrite.commit()is called.- Returns:
this.
-
recoveryMode
public MVStoreModuleBuilder recoveryMode(boolean recoveryMode)
Indicates whether the MVStore should be opened in recovery mode or not.- Returns:
this.
-
cacheSize
public MVStoreModuleBuilder cacheSize(int cacheSize)
The size of the read cache in MB used by the MVStore. The default value is 16MB.- Returns:
this.
-
cacheConcurrency
public MVStoreModuleBuilder cacheConcurrency(int cacheConcurrency)
The read cache concurrency used by MVStore. Default is 16 segments.- Returns:
this.
-
pageSplitSize
public MVStoreModuleBuilder pageSplitSize(int pageSplitSize)
The amount of memory a MVStore page should contain at most, in bytes, before it is split. The default is 16 KB.- Returns:
this.
-
fileStore
public MVStoreModuleBuilder fileStore(org.h2.mvstore.FileStore<?> fileStore)
The file store used by the MVStore.- Returns:
this.
-
dbConfig
public MVStoreModuleBuilder dbConfig(MVStoreConfig dbConfig)
The configuration for the MVStore.- Returns:
this.
-
-