public class SegmentGCOptions extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SegmentGCOptions.GCType
The gc type.
|
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()
|
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.
|
long |
getGcLogInterval() |
long |
getGcSizeDeltaEstimation() |
@NotNull SegmentGCOptions.GCType |
getGCType() |
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
|
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 |
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 |
setGCLogInterval(long gcLogInterval)
Set the number of nodes after which an update about the compaction process is logged
|
SegmentGCOptions |
setGcSizeDeltaEstimation(long gcSizeDeltaEstimation) |
void |
setGCType(@NotNull SegmentGCOptions.GCType gcType)
Set the gc type.
|
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() |
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()
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
@NotNull public @NotNull SegmentGCOptions.GCType getGCType()
public void setGCType(@NotNull @NotNull SegmentGCOptions.GCType gcType)
gcType
- the type of gc to run.public 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 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 setGCLogInterval(long gcLogInterval)
gcLogInterval
- update intervalpublic long getGcLogInterval()
Copyright © 2012–2020 The Apache Software Foundation. All rights reserved.