public class SegmentGCOptions extends Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DISABLE_ESTIMATION_DEFAULT
Default value for
isEstimationDisabled() |
static int |
FORCE_TIMEOUT_DEFAULT
Default value for
getForceTimeout() in seconds. |
static long |
GC_PROGRESS_LOG_DEFAULT
Default value for the gc progress log
|
static int |
MEMORY_THRESHOLD_DEFAULT
Default value for
getMemoryThreshold() |
static boolean |
PAUSE_DEFAULT
Default value for
isPaused() |
static int |
RETAINED_GENERATIONS_DEFAULT
Default value for
getRetainedGenerations() |
static int |
RETRY_COUNT_DEFAULT
Default value for
getRetryCount() |
static long |
SIZE_DELTA_ESTIMATION_DEFAULT
Default value for
getGcSizeDeltaEstimation(). |
| Constructor and Description |
|---|
SegmentGCOptions() |
SegmentGCOptions(boolean paused,
int retryCount,
int forceTimeout) |
| Modifier and Type | Method and Description |
|---|---|
static SegmentGCOptions |
defaultGCOptions()
|
long |
getBinaryDeduplicationMaxSize() |
int |
getForceTimeout()
Get the number of seconds to attempt to force compact concurrent commits on top of
already compacted commits after the maximum number of retries has been reached.
|
GCNodeWriteMonitor |
getGCNodeWriteMonitor() |
long |
getGcSizeDeltaEstimation() |
int |
getMemoryThreshold()
Get the available memory threshold beyond which revision gc will be
canceled.
|
int |
getRetainedGenerations()
Number of segment generations to retain.
|
int |
getRetryCount()
Get the number of tries to compact concurrent commits on top of already
compacted commits
|
boolean |
isBinaryDeduplication() |
static boolean |
isDiskSpaceSufficient(long repositoryDiskSpace,
long availableDiskSpace)
Check if the approximate repository size is getting too big compared with
the available space on disk.
|
boolean |
isEstimationDisabled() |
boolean |
isOffline() |
boolean |
isPaused() |
SegmentGCOptions |
setBinaryDeduplicationMaxSize(long binMaxSize)
Offline compaction only.
|
SegmentGCOptions |
setEstimationDisabled(boolean disabled)
Disables the estimation phase, thus allowing GC to run every time.
|
SegmentGCOptions |
setForceTimeout(int timeout)
Set the number of seconds to attempt to force compact concurrent commits on top of
already compacted commits after the maximum number of retries has been reached.
|
SegmentGCOptions |
setGcSizeDeltaEstimation(long gcSizeDeltaEstimation) |
SegmentGCOptions |
setMemoryThreshold(int memoryThreshold)
Set the available memory threshold beyond which revision gc will be
canceled.
|
SegmentGCOptions |
setOffline()
Enables the offline compaction mode, allowing for certain optimizations,
like reducing the retained generation to 1.
|
SegmentGCOptions |
setPaused(boolean paused)
Set revision gc to paused.
|
SegmentGCOptions |
setRetainedGenerations(int retainedGenerations)
Set the number of segment generations to retain: each compaction run creates
a new segment generation.
|
SegmentGCOptions |
setRetryCount(int retryCount)
Set the number of tries to compact concurrent commits on top of already
compacted commits
|
String |
toString() |
SegmentGCOptions |
withBinaryDeduplication()
Offline compaction only.
|
SegmentGCOptions |
withGCNodeWriteMonitor(long gcProgressLog)
Enables the GcWriteMonitor with the given params.
|
public static final boolean PAUSE_DEFAULT
isPaused()public static final boolean DISABLE_ESTIMATION_DEFAULT
isEstimationDisabled()public static final int RETRY_COUNT_DEFAULT
getRetryCount()public static final int FORCE_TIMEOUT_DEFAULT
getForceTimeout() in seconds.public static final int RETAINED_GENERATIONS_DEFAULT
getRetainedGenerations()public static final long SIZE_DELTA_ESTIMATION_DEFAULT
getGcSizeDeltaEstimation().public static final long GC_PROGRESS_LOG_DEFAULT
public static final int MEMORY_THRESHOLD_DEFAULT
getMemoryThreshold()public SegmentGCOptions(boolean paused,
int retryCount,
int forceTimeout)
public SegmentGCOptions()
public static SegmentGCOptions defaultGCOptions()
public boolean isPaused()
true iff revision gc is paused.public SegmentGCOptions setPaused(boolean paused)
paused - public int getRetryCount()
public SegmentGCOptions setRetryCount(int retryCount)
retryCount - public int getForceTimeout()
public SegmentGCOptions setForceTimeout(int timeout)
timeout - the number of seconds until forced compaction gives up and the exclusive
lock on the node store is released.public int getRetainedGenerations()
setRetainedGenerations(int)public SegmentGCOptions setRetainedGenerations(int retainedGenerations)
retainGenerations determines how many of
those generations are retained during cleanup.retainedGenerations - number of generations to retain. Must be >= 2.IllegalArgumentException - if retainGenerations < 2public static boolean isDiskSpaceSufficient(long repositoryDiskSpace,
long availableDiskSpace)
repositoryDiskSpace - Approximate size of the disk space occupied by
the repository.availableDiskSpace - Currently available disk space.true if the available disk space is considered enough for
normal repository operations.public boolean isOffline()
public SegmentGCOptions setOffline()
public SegmentGCOptions withBinaryDeduplication()
public boolean isBinaryDeduplication()
public SegmentGCOptions setBinaryDeduplicationMaxSize(long binMaxSize)
binMaxSize - public long getBinaryDeduplicationMaxSize()
public long getGcSizeDeltaEstimation()
public SegmentGCOptions setGcSizeDeltaEstimation(long gcSizeDeltaEstimation)
public int getMemoryThreshold()
0 and
100 will be returned.public SegmentGCOptions setMemoryThreshold(int memoryThreshold)
0 and
100 is expected. Setting this to 0 will disable the
check.memoryThreshold - public boolean isEstimationDisabled()
public SegmentGCOptions setEstimationDisabled(boolean disabled)
public SegmentGCOptions withGCNodeWriteMonitor(long gcProgressLog)
gcProgressLog - Enables compaction progress logging at each set of compacted nodes, disabled if set to
-1public GCNodeWriteMonitor getGCNodeWriteMonitor()
Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.