public class SegmentGCOptions extends Object
Modifier and Type | Field and Description |
---|---|
static int |
FORCE_TIMEOUT_DEFAULT
Default value for
getForceTimeout() in seconds. |
static byte |
GAIN_THRESHOLD_DEFAULT
Default value for
getGainThreshold() |
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 gainThreshold,
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.
|
int |
getGainThreshold()
Get the gain estimate threshold beyond which revision gc should run
|
long |
getGcSizeDeltaEstimation() |
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() |
boolean |
isDiskSpaceSufficient(long repositoryDiskSpace,
long availableDiskSpace)
Check if the approximate repository size is getting too big compared with
the available space on disk.
|
boolean |
isGcSizeDeltaEstimation() |
boolean |
isOffline() |
boolean |
isPaused() |
SegmentGCOptions |
setBinaryDeduplicationMaxSize(long binMaxSize)
Offline compaction only.
|
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 |
setGainThreshold(int gainThreshold)
Set the revision gain estimate threshold beyond which revision gc should run
|
SegmentGCOptions |
setGcSizeDeltaEstimation(long gcSizeDeltaEstimation) |
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.
|
public static final boolean PAUSE_DEFAULT
isPaused()
public static final byte GAIN_THRESHOLD_DEFAULT
getGainThreshold()
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 SegmentGCOptions(boolean paused, int gainThreshold, 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 getGainThreshold()
public SegmentGCOptions setGainThreshold(int gainThreshold)
gainThreshold
- 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 < 2
public 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 boolean isGcSizeDeltaEstimation()
public long getGcSizeDeltaEstimation()
public SegmentGCOptions setGcSizeDeltaEstimation(long gcSizeDeltaEstimation)
Copyright © 2012-2016 The Apache Software Foundation. All Rights Reserved.