Class SegmentRevisionGCMBean
- java.lang.Object
-
- javax.management.StandardMBean
-
- org.apache.jackrabbit.oak.commons.jmx.AnnotatedStandardMBean
-
- org.apache.jackrabbit.oak.segment.compaction.SegmentRevisionGCMBean
-
- All Implemented Interfaces:
DynamicMBean
,MBeanRegistration
,SegmentRevisionGC
public class SegmentRevisionGCMBean extends AnnotatedStandardMBean implements SegmentRevisionGC
-
-
Field Summary
-
Fields inherited from interface org.apache.jackrabbit.oak.segment.compaction.SegmentRevisionGC
TYPE
-
-
Constructor Summary
Constructors Constructor Description SegmentRevisionGCMBean(@NotNull FileStore fileStore, @NotNull SegmentGCOptions gcOptions, @NotNull FileStoreGCMonitor fileStoreGCMonitor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancelRevisionGC()
Cancel a running revision garbage collection operation.long
getCompactedNodes()
long
getEstimatedCompactableNodes()
int
getEstimatedRevisionGCCompletion()
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
getGcSizeDeltaEstimation()
String
getGCType()
long
getLastCleanup()
long
getLastCompaction()
@Nullable String
getLastError()
@NotNull String
getLastLogMessage()
long
getLastReclaimedSize()
long
getLastRepositorySize()
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 commitslong
getRevisionGCProgressLog()
@NotNull String
getStatus()
boolean
isEstimationDisabled()
boolean
isPausedCompaction()
boolean
isRevisionGCRunning()
void
setEstimationDisabled(boolean disabled)
Disables the estimation phase, thus allowing GC to run every time.void
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.void
setGcSizeDeltaEstimation(long gcSizeDeltaEstimation)
void
setGCType(String gcType)
void
setMemoryThreshold(int memoryThreshold)
Set the available memory threshold beyond which revision gc will be canceled.void
setPausedCompaction(boolean paused)
Set revision gc to paused.void
setRetainedGenerations(int retainedGenerations)
Set the number of segment generations to retain: each compaction run creates a new segment generation.void
setRetryCount(int retryCount)
Set the number of tries to compact concurrent commits on top of already compacted commitsvoid
setRevisionGCProgressLog(long gcProgressLog)
Set the size of the logging interval,-1
means disabledvoid
startRevisionGC()
Initiate a revision garbage collection operation-
Methods inherited from class org.apache.jackrabbit.oak.commons.jmx.AnnotatedStandardMBean
getDescription, getDescription, getDescription, getDescription, getImpact, getParameterName
-
Methods inherited from class javax.management.StandardMBean
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getDescription, getDescription, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, getParameterName, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementation
-
-
-
-
Constructor Detail
-
SegmentRevisionGCMBean
public SegmentRevisionGCMBean(@NotNull @NotNull FileStore fileStore, @NotNull @NotNull SegmentGCOptions gcOptions, @NotNull @NotNull FileStoreGCMonitor fileStoreGCMonitor)
-
-
Method Detail
-
isPausedCompaction
public boolean isPausedCompaction()
- Specified by:
isPausedCompaction
in interfaceSegmentRevisionGC
- Returns:
true
iff revision gc is paused.
-
setPausedCompaction
public void setPausedCompaction(boolean paused)
Description copied from interface:SegmentRevisionGC
Set revision gc to paused.- Specified by:
setPausedCompaction
in interfaceSegmentRevisionGC
-
getRetryCount
public int getRetryCount()
Description copied from interface:SegmentRevisionGC
Get the number of tries to compact concurrent commits on top of already compacted commits- Specified by:
getRetryCount
in interfaceSegmentRevisionGC
- Returns:
- retry count
-
setRetryCount
public void setRetryCount(int retryCount)
Description copied from interface:SegmentRevisionGC
Set the number of tries to compact concurrent commits on top of already compacted commits- Specified by:
setRetryCount
in interfaceSegmentRevisionGC
-
getForceTimeout
public int getForceTimeout()
Description copied from interface:SegmentRevisionGC
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. Forced compaction acquires an exclusive write lock on the node store.- Specified by:
getForceTimeout
in interfaceSegmentRevisionGC
- Returns:
- the number of seconds until forced compaction gives up and the exclusive write lock on the node store is released.
-
setForceTimeout
public void setForceTimeout(int timeout)
Description copied from interface:SegmentRevisionGC
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. Forced compaction acquires an exclusively write lock on the node store.- Specified by:
setForceTimeout
in interfaceSegmentRevisionGC
- Parameters:
timeout
- the number of seconds until forced compaction gives up and the exclusive lock on the node store is released.
-
getRetainedGenerations
public int getRetainedGenerations()
Description copied from interface:SegmentRevisionGC
Number of segment generations to retain.- Specified by:
getRetainedGenerations
in interfaceSegmentRevisionGC
- Returns:
- number of gc generations.
- See Also:
SegmentRevisionGC.setRetainedGenerations(int)
-
setRetainedGenerations
public void setRetainedGenerations(int retainedGenerations)
Description copied from interface:SegmentRevisionGC
Set the number of segment generations to retain: each compaction run creates a new segment generation.retainGenerations
determines how many of those generations are retained during cleanup.- Specified by:
setRetainedGenerations
in interfaceSegmentRevisionGC
- Parameters:
retainedGenerations
- number of generations to retain. Must be>= 2
.
-
getGcSizeDeltaEstimation
public long getGcSizeDeltaEstimation()
- Specified by:
getGcSizeDeltaEstimation
in interfaceSegmentRevisionGC
-
setGcSizeDeltaEstimation
public void setGcSizeDeltaEstimation(long gcSizeDeltaEstimation)
- Specified by:
setGcSizeDeltaEstimation
in interfaceSegmentRevisionGC
-
isEstimationDisabled
public boolean isEstimationDisabled()
- Specified by:
isEstimationDisabled
in interfaceSegmentRevisionGC
-
setEstimationDisabled
public void setEstimationDisabled(boolean disabled)
Description copied from interface:SegmentRevisionGC
Disables the estimation phase, thus allowing GC to run every time.- Specified by:
setEstimationDisabled
in interfaceSegmentRevisionGC
-
getGCType
public String getGCType()
- Specified by:
getGCType
in interfaceSegmentRevisionGC
-
setGCType
public void setGCType(String gcType)
- Specified by:
setGCType
in interfaceSegmentRevisionGC
-
startRevisionGC
public void startRevisionGC()
Description copied from interface:SegmentRevisionGC
Initiate a revision garbage collection operation- Specified by:
startRevisionGC
in interfaceSegmentRevisionGC
-
cancelRevisionGC
public void cancelRevisionGC()
Description copied from interface:SegmentRevisionGC
Cancel a running revision garbage collection operation. Does nothing if revision garbage collection is not running.- Specified by:
cancelRevisionGC
in interfaceSegmentRevisionGC
-
getLastCompaction
public long getLastCompaction()
- Specified by:
getLastCompaction
in interfaceSegmentRevisionGC
- Returns:
- time of the last compaction in milliseconds.
-
getLastCleanup
public long getLastCleanup()
- Specified by:
getLastCleanup
in interfaceSegmentRevisionGC
- Returns:
- time of the last cleanup in milliseconds.
-
getLastRepositorySize
public long getLastRepositorySize()
- Specified by:
getLastRepositorySize
in interfaceSegmentRevisionGC
- Returns:
- repository size after the last cleanup.
-
getLastReclaimedSize
public long getLastReclaimedSize()
- Specified by:
getLastReclaimedSize
in interfaceSegmentRevisionGC
- Returns:
- reclaimed size during the last cleanup.
-
getLastError
@Nullable public @Nullable String getLastError()
- Specified by:
getLastError
in interfaceSegmentRevisionGC
- Returns:
- last error or
null
if none.
-
getLastLogMessage
@NotNull public @NotNull String getLastLogMessage()
- Specified by:
getLastLogMessage
in interfaceSegmentRevisionGC
- Returns:
- last log message or
null
if none.
-
getStatus
@NotNull public @NotNull String getStatus()
- Specified by:
getStatus
in interfaceSegmentRevisionGC
- Returns:
- current status.
-
getMemoryThreshold
public int getMemoryThreshold()
Description copied from interface:SegmentRevisionGC
Get the available memory threshold beyond which revision gc will be canceled. Value represents a percentage so an value between 0 and 100 will be returned.- Specified by:
getMemoryThreshold
in interfaceSegmentRevisionGC
- Returns:
- memory threshold
-
setMemoryThreshold
public void setMemoryThreshold(int memoryThreshold)
Description copied from interface:SegmentRevisionGC
Set the available memory threshold beyond which revision gc will be canceled. Value represents a percentage so an input between0
and100
is expected. Setting this to0
will disable the check.- Specified by:
setMemoryThreshold
in interfaceSegmentRevisionGC
-
isRevisionGCRunning
public boolean isRevisionGCRunning()
- Specified by:
isRevisionGCRunning
in interfaceSegmentRevisionGC
- Returns:
true
if there is an online compaction cycle running
-
getCompactedNodes
public long getCompactedNodes()
- Specified by:
getCompactedNodes
in interfaceSegmentRevisionGC
- Returns:
- number of compacted nodes in the current cycle
-
getEstimatedCompactableNodes
public long getEstimatedCompactableNodes()
- Specified by:
getEstimatedCompactableNodes
in interfaceSegmentRevisionGC
- Returns:
- number of estimated nodes to be compacted in the current cycle.
Can be
-1
if the estimation can't be performed
-
getEstimatedRevisionGCCompletion
public int getEstimatedRevisionGCCompletion()
- Specified by:
getEstimatedRevisionGCCompletion
in interfaceSegmentRevisionGC
- Returns:
- percentage of progress for the current compaction cycle. Can be
-1
if the estimation can't be performed.
-
getRevisionGCProgressLog
public long getRevisionGCProgressLog()
- Specified by:
getRevisionGCProgressLog
in interfaceSegmentRevisionGC
- Returns:
- Number of nodes the monitor will log a message,
-1
means disabled
-
setRevisionGCProgressLog
public void setRevisionGCProgressLog(long gcProgressLog)
Description copied from interface:SegmentRevisionGC
Set the size of the logging interval,-1
means disabled- Specified by:
setRevisionGCProgressLog
in interfaceSegmentRevisionGC
- Parameters:
gcProgressLog
- number of nodes
-
-