Package org.dizitart.no2.mvstore
Class MVStoreModuleBuilder
java.lang.Object
org.dizitart.no2.mvstore.MVStoreModuleBuilder
The MVStoreModuleBuilder class is responsible for building an instance of
MVStoreModule. It provides methods to set various configuration
options for the MVStore database.- Since:
- 4.0
- Author:
- Anindya Chatterjee
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionaddStoreEventListener(org.dizitart.no2.store.events.StoreEventListener listener) Adds aStoreEventListenerto the module builder.booleanFlag to enable/disable auto-commit mode.autoCommit(boolean autoCommit) Flag to enable/disable auto-commit mode.intThe size of the buffer used for auto-commit.autoCommitBufferSize(int autoCommitBufferSize) The size of the buffer used for auto-commit.build()Builds an instance ofMVStoreModulewith the configured parameters.intThe read cache concurrency used by MVStore.cacheConcurrency(int cacheConcurrency) The read cache concurrency used by MVStore.intThe size of the read cache in MB used by the MVStore.cacheSize(int cacheSize) The size of the read cache in MB used by the MVStore.booleancompress()Flag to enable/disable compression of data in MVStore.compress(boolean compress) Flag to enable/disable compression of data in MVStore.booleanFlag to enable high compression for the MVStore.compressHigh(boolean compressHigh) Flag to enable high compression for the MVStore.dbConfig()The configuration for the MVStore.dbConfig(MVStoreConfig dbConfig) The configuration for the MVStore.char[]The encryption key to be used for encrypting the MVStore.encryptionKey(char[] encryptionKey) The encryption key to be used for encrypting the MVStore.Set<org.dizitart.no2.store.events.StoreEventListener>Set of event listeners to be registered with the MVStore.filePath()The file path of the MVStore file.Sets the file path for the MVStore.Sets the file path for the MVStore.org.h2.mvstore.FileStore<?>The file store used by the MVStore.fileStore(org.h2.mvstore.FileStore<?> fileStore) The file store used by the MVStore.intThe amount of memory a MVStore page should contain at most, in bytes, before it is split.pageSplitSize(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.readOnly(boolean readOnly) Indicates whether the MVStore instance should be opened in read-only mode.booleanIndicates whether the MVStore should be opened in recovery mode or not.recoveryMode(boolean recoveryMode) Indicates whether the MVStore should be opened in recovery mode or not.
-
Method Details
-
filePath
Sets the file path for the MVStore.- Parameters:
file- the file path for the MVStore.- Returns:
- the MVStoreModuleBuilder instance.
-
filePath
Sets the file path for the MVStore.- Parameters:
path- the file path for the MVStore.- Returns:
- the MVStoreModuleBuilder instance.
-
addStoreEventListener
public MVStoreModuleBuilder addStoreEventListener(org.dizitart.no2.store.events.StoreEventListener listener) Adds aStoreEventListenerto the module builder.- Parameters:
listener- the listener to be added- Returns:
- the module builder instance
-
build
Builds an instance ofMVStoreModulewith the configured parameters.- Returns:
- an instance of
MVStoreModule.
-
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
The configuration for the MVStore. -
eventListeners
Set of event listeners to be registered with the MVStore. -
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
The encryption key to be used for encrypting the MVStore.- Returns:
this.
-
readOnly
Indicates whether the MVStore instance should be opened in read-only mode.- Returns:
this.
-
compress
Flag to enable/disable compression of data in MVStore.- Returns:
this.
-
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
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
Indicates whether the MVStore should be opened in recovery mode or not.- Returns:
this.
-
cacheSize
The size of the read cache in MB used by the MVStore. The default value is 16MB.- Returns:
this.
-
cacheConcurrency
The read cache concurrency used by MVStore. Default is 16 segments.- Returns:
this.
-
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
The file store used by the MVStore.- Returns:
this.
-
dbConfig
The configuration for the MVStore.- Returns:
this.
-