Class FileStoreBuilder


  • public class FileStoreBuilder
    extends java.lang.Object
    Builder for creating FileStore instances.
    • Field Detail

    • Method Detail

      • fileStoreBuilder

        @NotNull
        public static @NotNull FileStoreBuilder fileStoreBuilder​(@NotNull
                                                                 @NotNull java.io.File directory)
        Create a new instance of a FileStoreBuilder for a file store.
        Parameters:
        directory - directory where the tar files are stored
        Returns:
        a new FileStoreBuilder instance.
      • withBlobStore

        @NotNull
        public @NotNull FileStoreBuilder withBlobStore​(@NotNull
                                                       @NotNull BlobStore blobStore)
        Specify the BlobStore.
        Parameters:
        blobStore -
        Returns:
        this instance
      • withMaxFileSize

        @NotNull
        public @NotNull FileStoreBuilder withMaxFileSize​(int maxFileSize)
        Maximal size of the generated tar files in MB.
        Parameters:
        maxFileSize -
        Returns:
        this instance
      • withSegmentCacheSize

        @NotNull
        public @NotNull FileStoreBuilder withSegmentCacheSize​(int segmentCacheSize)
        Size of the segment cache in MB.
        Parameters:
        segmentCacheSize - None negative cache size
        Returns:
        this instance
      • withStringCacheSize

        @NotNull
        public @NotNull FileStoreBuilder withStringCacheSize​(int stringCacheSize)
        Size of the string cache in MB.
        Parameters:
        stringCacheSize - None negative cache size
        Returns:
        this instance
      • withTemplateCacheSize

        @NotNull
        public @NotNull FileStoreBuilder withTemplateCacheSize​(int templateCacheSize)
        Size of the template cache in MB.
        Parameters:
        templateCacheSize - None negative cache size
        Returns:
        this instance
      • withStringDeduplicationCacheSize

        @NotNull
        public @NotNull FileStoreBuilder withStringDeduplicationCacheSize​(int stringDeduplicationCacheSize)
        Number of items to keep in the string deduplication cache
        Parameters:
        stringDeduplicationCacheSize - None negative cache size
        Returns:
        this instance
      • withTemplateDeduplicationCacheSize

        @NotNull
        public @NotNull FileStoreBuilder withTemplateDeduplicationCacheSize​(int templateDeduplicationCacheSize)
        Number of items to keep in the template deduplication cache
        Parameters:
        templateDeduplicationCacheSize - None negative cache size
        Returns:
        this instance
      • withNodeDeduplicationCacheSize

        @NotNull
        public @NotNull FileStoreBuilder withNodeDeduplicationCacheSize​(int nodeDeduplicationCacheSize)
        Number of items to keep in the node deduplication cache
        Parameters:
        nodeDeduplicationCacheSize - None negative cache size. Must be a power of 2.
        Returns:
        this instance
      • withMemoryMapping

        @NotNull
        public @NotNull FileStoreBuilder withMemoryMapping​(boolean memoryMapping)
        Turn memory mapping on or off
        Parameters:
        memoryMapping -
        Returns:
        this instance
      • withOffHeapAccess

        @NotNull
        public @NotNull FileStoreBuilder withOffHeapAccess​(boolean offHeapAccess)
        Turn off heap access on or off
        Parameters:
        offHeapAccess -
        Returns:
        this instance
      • withDefaultMemoryMapping

        @NotNull
        public @NotNull FileStoreBuilder withDefaultMemoryMapping()
        Set memory mapping to the default value based on OS properties
        Returns:
        this instance
      • withGCMonitor

        @NotNull
        public @NotNull FileStoreBuilder withGCMonitor​(@NotNull
                                                       @NotNull GCMonitor gcMonitor)
        GCMonitor for monitoring this files store's gc process.
        Parameters:
        gcMonitor -
        Returns:
        this instance
      • withStatisticsProvider

        @NotNull
        public @NotNull FileStoreBuilder withStatisticsProvider​(@NotNull
                                                                @NotNull StatisticsProvider statisticsProvider)
        StatisticsProvider for collecting statistics related to FileStore
        Parameters:
        statisticsProvider -
        Returns:
        this instance
      • withIOLogging

        @NotNull
        public @NotNull FileStoreBuilder withIOLogging​(@NotNull
                                                       @NotNull Logger logger)
        Log IO reads at debug level to the passed logger
        Parameters:
        logger - logger for logging IO reads
        Returns:
        this.
      • withStrictVersionCheck

        @NotNull
        public @NotNull FileStoreBuilder withStrictVersionCheck​(boolean strictVersionCheck)
        Enable strict version checking. With strict version checking enabled Oak will fail to start if the store version does not exactly match this Oak version. This is useful to e.g. avoid inadvertent upgrades during when running offline compaction accidentally against an older version of a store.
        Parameters:
        strictVersionCheck - enables strict version checking iff true.
        Returns:
        this instance
      • withEagerSegmentCaching

        public FileStoreBuilder withEagerSegmentCaching​(boolean eagerSegmentCaching)
        Enable eager segment caching. This proves useful when segments need to be cached as soon as they are created, right before persisting them to disk. One such scenario is the cold standby, see OAK-8006.
        Parameters:
        eagerSegmentCaching - enables eager segment caching iff true.
        Returns:
        this instance
      • withBinariesInlineThreshold

        public FileStoreBuilder withBinariesInlineThreshold​(int binariesInlineThreshold)
        Sets the threshold under which binaries are inlined in data segments.
        Parameters:
        binariesInlineThreshold - the threshold
        Returns:
        this instance
      • buildProcBackend

        public Proc.Backend buildProcBackend​(AbstractFileStore fileStore)
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • getMaxFileSize

        public int getMaxFileSize()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object