Class MVStoreModuleBuilder


  • public class MVStoreModuleBuilder
    extends Object
    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:
    MVStoreModule
    • 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.
      • 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 when Nitrite.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 when Nitrite.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.