Interface EmbeddedStorageConfigurationBuilder

    • Method Detail

      • setStorageDirectory

        EmbeddedStorageConfigurationBuilder setStorageDirectory​(String storageDirectory)
        The base directory of the storage in the file system.
        Parameters:
        storageDirectory - the storage directory
        Returns:
        this
      • setStorageDirectoryInUserHome

        default EmbeddedStorageConfigurationBuilder setStorageDirectoryInUserHome​(String storageDirectoryInUserHome)
        The base directory of the storage in the file system.
        Parameters:
        storageDirectoryInUserHome - relative location in the user home directory
        Returns:
        this
      • setTruncationDirectory

        EmbeddedStorageConfigurationBuilder setTruncationDirectory​(String truncationDirectory)
        The truncation directory.
        Parameters:
        truncationDirectory - the trunctation directory
        Returns:
        this
      • setBackupDirectoryInUserHome

        default EmbeddedStorageConfigurationBuilder setBackupDirectoryInUserHome​(String backupDirectoryInUserHome)
        The backup directory.
        Parameters:
        backupDirectoryInUserHome - relative location in the user home directory
        Returns:
        this
      • setChannelCount

        EmbeddedStorageConfigurationBuilder setChannelCount​(int channelCount)
        The number of threads and number of directories used by the storage engine. Every thread has exclusive access to its directory. Default is 1.
        Parameters:
        channelCount - the new channel count, must be a power of 2
        Returns:
        this
      • setChannelDirectoryPrefix

        EmbeddedStorageConfigurationBuilder setChannelDirectoryPrefix​(String channelDirectoryPrefix)
        Name prefix of the subdirectories used by the channel threads. Default is "channel_".
        Parameters:
        channelDirectoryPrefix - new prefix
        Returns:
        this
      • setDataFilePrefix

        EmbeddedStorageConfigurationBuilder setDataFilePrefix​(String dataFilePrefix)
        Name prefix of the storage files. Default is "channel_".
        Parameters:
        dataFilePrefix - new prefix
        Returns:
        this
      • setDataFileSuffix

        EmbeddedStorageConfigurationBuilder setDataFileSuffix​(String dataFileSuffix)
        Name suffix of the storage files. Default is ".dat".
        Parameters:
        dataFileSuffix - new suffix
        Returns:
        this
      • setTransactionFilePrefix

        EmbeddedStorageConfigurationBuilder setTransactionFilePrefix​(String transactionFilePrefix)
        Name prefix of the storage transaction file. Default is "transactions_".
        Parameters:
        transactionFilePrefix - new prefix
        Returns:
        this
      • setTransactionFileSuffix

        EmbeddedStorageConfigurationBuilder setTransactionFileSuffix​(String transactionFileSuffix)
        Name suffix of the storage transaction file. Default is ".sft".
        Parameters:
        transactionFileSuffix - new suffix
        Returns:
        this
      • setTypeDictionaryFileName

        EmbeddedStorageConfigurationBuilder setTypeDictionaryFileName​(String typeDictionaryFileName)
        The name of the dictionary file. Default is "PersistenceTypeDictionary.ptd".
        Parameters:
        typeDictionaryFileName - new name
        Returns:
        this
      • setHousekeepingTimeBudget

        EmbeddedStorageConfigurationBuilder setHousekeepingTimeBudget​(Duration housekeepingTimeBudget)
        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
        Returns:
        this
        See Also:
        setHousekeepingInterval(Duration)
      • setEntityCacheThreshold

        EmbeddedStorageConfigurationBuilder setEntityCacheThreshold​(long entityCacheThreshold)
        Abstract threshold value for the lifetime of entities in the cache. See StorageEntityCacheEvaluator.New(long, long). Default is 1.000.000.000.
        Parameters:
        entityCacheThreshold - the new threshold
        Returns:
        this
        See Also:
        setEntityCacheTimeout(Duration)
      • setEntityCacheTimeout

        EmbeddedStorageConfigurationBuilder setEntityCacheTimeout​(Duration entityCacheTimeout)
        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. See StorageEntityCacheEvaluator.New(long, long).
        Parameters:
        entityCacheTimeout - the new timeout
        Returns:
        this
        See Also:
        Duration, setEntityCacheThreshold(long)
      • setDataFileMinimumUseRatio

        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. "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:
        this
      • setDataFileCleanupHeadFile

        EmbeddedStorageConfigurationBuilder setDataFileCleanupHeadFile​(boolean 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 - the new clean head file
        Returns:
        this