Class FileStoreBuilder
- java.lang.Object
-
- org.apache.jackrabbit.oak.segment.file.FileStoreBuilder
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_FILE_SIZE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull FileStore
build()
Create a newFileStore
instance with the settings specified in this builder.Proc.Backend
buildProcBackend(AbstractFileStore fileStore)
@NotNull ReadOnlyFileStore
buildReadOnly()
Create a newReadOnlyFileStore
instance with the settings specified in this builder.static @NotNull FileStoreBuilder
fileStoreBuilder(@NotNull File directory)
Create a new instance of aFileStoreBuilder
for a file store.@NotNull WriterCacheManager
getCacheManager()
int
getMaxFileSize()
String
toString()
FileStoreBuilder
withBinariesInlineThreshold(int binariesInlineThreshold)
Sets the threshold under which binaries are inlined in data segments.@NotNull FileStoreBuilder
withBlobStore(@NotNull BlobStore blobStore)
Specify theBlobStore
.FileStoreBuilder
withCustomPersistence(SegmentNodeStorePersistence persistence)
@NotNull FileStoreBuilder
withDefaultMemoryMapping()
Set memory mapping to the default value based on OS propertiesFileStoreBuilder
withEagerSegmentCaching(boolean eagerSegmentCaching)
Enable eager segment caching.@NotNull FileStoreBuilder
withGCMonitor(@NotNull GCMonitor gcMonitor)
GCMonitor
for monitoring this files store's gc process.@NotNull FileStoreBuilder
withGCOptions(SegmentGCOptions gcOptions)
SegmentGCOptions
the garbage collection options of the store@NotNull FileStoreBuilder
withIOLogging(@NotNull Logger logger)
Log IO reads at debug level to the passed logger@NotNull FileStoreBuilder
withIOMonitor(@NotNull IOMonitor ioMonitor)
@NotNull FileStoreBuilder
withMaxFileSize(int maxFileSize)
Maximal size of the generated tar files in MB.@NotNull FileStoreBuilder
withMemoryMapping(boolean memoryMapping)
Turn memory mapping on or off@NotNull FileStoreBuilder
withNodeDeduplicationCacheSize(int nodeDeduplicationCacheSize)
Number of items to keep in the node deduplication cache@NotNull FileStoreBuilder
withOffHeapAccess(boolean offHeapAccess)
Turn off heap access on or off@NotNull FileStoreBuilder
withRemoteStoreMonitor(@NotNull RemoteStoreMonitor remoteStoreMonitor)
@NotNull FileStoreBuilder
withSegmentCacheSize(int segmentCacheSize)
Size of the segment cache in MB.@NotNull FileStoreBuilder
withSnfeListener(@NotNull SegmentNotFoundExceptionListener snfeListener)
SegmentNotFoundExceptionListener
listener forSegmentNotFoundException
@NotNull FileStoreBuilder
withStatisticsProvider(@NotNull StatisticsProvider statisticsProvider)
StatisticsProvider
for collecting statistics related to FileStore@NotNull FileStoreBuilder
withStrictVersionCheck(boolean strictVersionCheck)
Enable strict version checking.@NotNull FileStoreBuilder
withStringCacheSize(int stringCacheSize)
Size of the string cache in MB.@NotNull FileStoreBuilder
withStringDeduplicationCacheSize(int stringDeduplicationCacheSize)
Number of items to keep in the string deduplication cache@NotNull FileStoreBuilder
withTemplateCacheSize(int templateCacheSize)
Size of the template cache in MB.@NotNull FileStoreBuilder
withTemplateDeduplicationCacheSize(int templateDeduplicationCacheSize)
Number of items to keep in the template deduplication cache
-
-
-
Field Detail
-
DEFAULT_MAX_FILE_SIZE
public static final int DEFAULT_MAX_FILE_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
fileStoreBuilder
@NotNull public static @NotNull FileStoreBuilder fileStoreBuilder(@NotNull @NotNull File directory)
Create a new instance of aFileStoreBuilder
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 theBlobStore
.- 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
-
withGCOptions
@NotNull public @NotNull FileStoreBuilder withGCOptions(SegmentGCOptions gcOptions)
SegmentGCOptions
the garbage collection options of the store- Parameters:
gcOptions
-- Returns:
- this instance
-
withSnfeListener
@NotNull public @NotNull FileStoreBuilder withSnfeListener(@NotNull @NotNull SegmentNotFoundExceptionListener snfeListener)
SegmentNotFoundExceptionListener
listener forSegmentNotFoundException
- Parameters:
snfeListener
- , the actual listener- Returns:
- this instance
-
withIOMonitor
@NotNull public @NotNull FileStoreBuilder withIOMonitor(@NotNull @NotNull IOMonitor ioMonitor)
-
withRemoteStoreMonitor
@NotNull public @NotNull FileStoreBuilder withRemoteStoreMonitor(@NotNull @NotNull RemoteStoreMonitor remoteStoreMonitor)
-
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 ifftrue
.- Returns:
- this instance
-
withCustomPersistence
public FileStoreBuilder withCustomPersistence(SegmentNodeStorePersistence persistence)
-
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 ifftrue
.- 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 IOException
- Throws:
IOException
-
build
@NotNull public @NotNull FileStore build() throws InvalidFileStoreVersionException, IOException
Create a newFileStore
instance with the settings specified in this builder. If none of thewith
methods have been called before calling this method, a file store with the following default settings is returned:- blob store: inline
- max file size: 256MB
- cache size: 256MB
- memory mapping: on for 64 bit JVMs off otherwise
- whiteboard: none. No
GCMonitor
tracking - statsProvider:
StatisticsProvider.NOOP
- GC options:
SegmentGCOptions.defaultGCOptions()
- Returns:
- a new file store instance
- Throws:
IOException
InvalidFileStoreVersionException
-
buildReadOnly
@NotNull public @NotNull ReadOnlyFileStore buildReadOnly() throws InvalidFileStoreVersionException, IOException
Create a newReadOnlyFileStore
instance with the settings specified in this builder. If none of thewith
methods have been called before calling this method, a file store with the following default settings is returned:- blob store: inline
- max file size: 256MB
- cache size: 256MB
- memory mapping: on for 64 bit JVMs off otherwise
- whiteboard: none. No
GCMonitor
tracking - statsProvider:
StatisticsProvider.NOOP
- GC options:
SegmentGCOptions.defaultGCOptions()
- Returns:
- a new file store instance
- Throws:
IOException
InvalidFileStoreVersionException
-
getMaxFileSize
public int getMaxFileSize()
-
getCacheManager
@NotNull public @NotNull WriterCacheManager getCacheManager()
- Returns:
- creates or returns the
WriterCacheManager
this builder passes or passed to the store onbuild()
. - See Also:
withNodeDeduplicationCacheSize(int)
,withStringDeduplicationCacheSize(int)
,withTemplateDeduplicationCacheSize(int)
-
-