Class AzureCompact.Builder
- java.lang.Object
-
- org.apache.jackrabbit.oak.segment.azure.tool.AzureCompact.Builder
-
- Enclosing class:
- AzureCompact
public static class AzureCompact.Builder extends Object
Collect options for theCompactcommand.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AzureCompactbuild()Create an executable version of theCompactcommand.AzureCompact.BuilderwithCompactorType(SegmentGCOptions.CompactorType compactorType)The compactor type to be used by compaction.AzureCompact.BuilderwithConcurrency(int concurrency)The number of threads to be used for compaction.AzureCompact.BuilderwithDestinationBlobContainerClient(com.azure.storage.blob.BlobContainerClient destinationBlobContainerClient)AzureCompact.BuilderwithForce(boolean force)Whether to fail if run on an older version of the store of force upgrading its format.AzureCompact.BuilderwithGarbageThresholdGb(int garbageThresholdGb)The minimum garbage size in GB for the compaction to run.AzureCompact.BuilderwithGarbageThresholdPercentage(int garbageThresholdPercentage)The minimum garbage size in percentage for the compaction to run.AzureCompact.BuilderwithGCLogInterval(long gcLogInterval)The number of nodes after which an update about the compaction process is logged.AzureCompact.BuilderwithGCType(SegmentGCOptions.GCType gcType)The garbage collection type used.AzureCompact.BuilderwithPath(String path)The path (URI) to an existing segment store.AzureCompact.BuilderwithPersistentCachePath(String persistentCachePath)The path where segments in the persistent cache will be stored.AzureCompact.BuilderwithPersistentCacheSizeGb(Integer persistentCacheSizeGb)The maximum size in GB of the persistent disk cache.AzureCompact.BuilderwithRootPrefix(String rootPrefix)The root directory to an existing segment store.AzureCompact.BuilderwithSegmentCacheSize(int segmentCacheSize)The size of the segment cache in MB.AzureCompact.BuilderwithSourceBlobContainerClient(com.azure.storage.blob.BlobContainerClient sourceBlobContainerClient)AzureCompact.BuilderwithTargetPath(String targetPath)The path (URI) to the target segment store.AzureCompact.BuilderwithTargetRootPrefix(String targetRootPrefix)The root directory to the target segment store.
-
-
-
Method Detail
-
withPath
public AzureCompact.Builder withPath(String path)
The path (URI) to an existing segment store. This parameter is required.- Parameters:
path- the path to an existing segment store.- Returns:
- this builder.
-
withTargetPath
public AzureCompact.Builder withTargetPath(String targetPath)
The path (URI) to the target segment store.- Parameters:
targetPath- the path to the target segment store.- Returns:
- this builder
-
withRootPrefix
public AzureCompact.Builder withRootPrefix(String rootPrefix)
The root directory to an existing segment store.- Parameters:
rootPrefix- the directory to an existing segment store.- Returns:
- the builder
-
withTargetRootPrefix
public AzureCompact.Builder withTargetRootPrefix(String targetRootPrefix)
The root directory to the target segment store.- Parameters:
targetRootPrefix- the root directory to the target segmen store.- Returns:
- this builder
-
withForce
public AzureCompact.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 AzureCompact.Builder withSegmentCacheSize(int segmentCacheSize)
The size of the segment cache in MB. The default ofSegmentCache.DEFAULT_SEGMENT_CACHE_MBwhen this method is not invoked.- Parameters:
segmentCacheSize- cache size in MB- Returns:
- this builder
- Throws:
IllegalArgumentException- ifsegmentCacheSizeis not a positive integer.
-
withGCLogInterval
public AzureCompact.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.
-
withGCType
public AzureCompact.Builder withGCType(SegmentGCOptions.GCType gcType)
The garbage collection type used. If not specified it defaults to full compaction- Parameters:
gcType- the GC type- Returns:
- this builder
-
withCompactorType
public AzureCompact.Builder withCompactorType(SegmentGCOptions.CompactorType compactorType)
The compactor type to be used by compaction. If not specified it defaults to "parallel" compactor- Parameters:
compactorType- the compactor type- Returns:
- this builder
-
withConcurrency
public AzureCompact.Builder withConcurrency(int concurrency)
The number of threads to be used for compaction. This only applies to the "parallel" compactor- Parameters:
concurrency- the number of threads- Returns:
- this builder
-
withPersistentCachePath
public AzureCompact.Builder withPersistentCachePath(String persistentCachePath)
The path where segments in the persistent cache will be stored.- Parameters:
persistentCachePath- the path to the persistent cache.- Returns:
- this builder
-
withPersistentCacheSizeGb
public AzureCompact.Builder withPersistentCacheSizeGb(Integer persistentCacheSizeGb)
The maximum size in GB of the persistent disk cache.- Parameters:
persistentCacheSizeGb- the maximum size of the persistent cache.- Returns:
- this builder
-
withGarbageThresholdGb
public AzureCompact.Builder withGarbageThresholdGb(int garbageThresholdGb)
The minimum garbage size in GB for the compaction to run.- Parameters:
garbageThresholdGb- the minimum garbage size in GB for the compaction to run.- Returns:
- this builder
-
withGarbageThresholdPercentage
public AzureCompact.Builder withGarbageThresholdPercentage(int garbageThresholdPercentage)
The minimum garbage size in percentage for the compaction to run.- Parameters:
garbageThresholdPercentage- the minimum garbage size in percentage for the compaction to run.- Returns:
- this builder
-
withSourceBlobContainerClient
public AzureCompact.Builder withSourceBlobContainerClient(com.azure.storage.blob.BlobContainerClient sourceBlobContainerClient)
-
withDestinationBlobContainerClient
public AzureCompact.Builder withDestinationBlobContainerClient(com.azure.storage.blob.BlobContainerClient destinationBlobContainerClient)
-
build
public AzureCompact build()
Create an executable version of theCompactcommand.- Returns:
- an instance of
Runnable.
-
-