Class Compact.Builder
- java.lang.Object
-
- org.apache.jackrabbit.oak.segment.tool.Compact.Builder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Compact
build()
Create an executable version of theCompact
command.Compact.Builder
withCompactorType(SegmentGCOptions.CompactorType compactorType)
The compactor type to be used by compaction.Compact.Builder
withForce(boolean force)
Whether to fail if run on an older version of the store of force upgrading its format.Compact.Builder
withGCLogInterval(long gcLogInterval)
The number of nodes after which an update about the compaction process is logged.Compact.Builder
withMmap(@Nullable java.lang.Boolean mmap)
Whether to use memory mapped access or file access.Compact.Builder
withOs(java.lang.String os)
Which operating system the code is running on.Compact.Builder
withPath(java.io.File path)
The path to an existing segment store.Compact.Builder
withSegmentCacheSize(int segmentCacheSize)
The size of the segment cache in MB.
-
-
-
Method Detail
-
withPath
public Compact.Builder withPath(java.io.File path)
The path to an existing segment store. This parameter is required.- Parameters:
path
- the path to an existing segment store.- Returns:
- this builder.
-
withMmap
public Compact.Builder withMmap(@Nullable @Nullable java.lang.Boolean mmap)
Whether to use memory mapped access or file access.- Parameters:
mmap
-true
for memory mapped access,false
for file accessnull
to determine the access mode from the system architecture: memory mapped on 64 bit systems, file access on 32 bit systems.- Returns:
- this builder.
-
withOs
public Compact.Builder withOs(java.lang.String os)
Which operating system the code is running on.- Parameters:
os
- The operating system as returned by the "os.name" standard system property.- Returns:
- this builder.
-
withForce
public Compact.Builder withForce(boolean force)
Whether to fail if run on an older version of the store of force upgrading its format.- Parameters:
force
- upgrade ifftrue
- Returns:
- this builder.
-
withSegmentCacheSize
public Compact.Builder withSegmentCacheSize(int segmentCacheSize)
The size of the segment cache in MB. The default ofSegmentCache.DEFAULT_SEGMENT_CACHE_MB
when this method is not invoked.- Parameters:
segmentCacheSize
- cache size in MB- Returns:
- this builder
- Throws:
java.lang.IllegalArgumentException
- ifsegmentCacheSize
is not a positive integer.
-
withGCLogInterval
public Compact.Builder withGCLogInterval(long gcLogInterval)
The number of nodes after which an update about the compaction process is logged. Set to a negative number to disable progress logging. If not specified, it defaults to 150,000 nodes.- Parameters:
gcLogInterval
- The log interval.- Returns:
- this builder.
-
withCompactorType
public Compact.Builder withCompactorType(SegmentGCOptions.CompactorType compactorType)
The compactor type to be used by compaction. If not specified it defaults to "diff" compactor- Parameters:
compactorType
- the compactor type- Returns:
- this builder
-
-