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
  • Constructor Details

  • Method Details

    • isPausedCompaction

      public boolean isPausedCompaction()
      Specified by:
      isPausedCompaction in interface SegmentRevisionGC
      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 interface SegmentRevisionGC
    • 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 interface SegmentRevisionGC
      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 interface SegmentRevisionGC
    • 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 interface SegmentRevisionGC
      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 interface SegmentRevisionGC
      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 interface SegmentRevisionGC
      Returns:
      number of gc generations.
      See Also:
    • 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 interface SegmentRevisionGC
      Parameters:
      retainedGenerations - number of generations to retain. Must be >= 2.
    • getGcSizeDeltaEstimation

      public long getGcSizeDeltaEstimation()
      Specified by:
      getGcSizeDeltaEstimation in interface SegmentRevisionGC
    • setGcSizeDeltaEstimation

      public void setGcSizeDeltaEstimation(long gcSizeDeltaEstimation)
      Specified by:
      setGcSizeDeltaEstimation in interface SegmentRevisionGC
    • isEstimationDisabled

      public boolean isEstimationDisabled()
      Specified by:
      isEstimationDisabled in interface SegmentRevisionGC
    • 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 interface SegmentRevisionGC
    • getGCType

      public String getGCType()
      Specified by:
      getGCType in interface SegmentRevisionGC
    • setGCType

      public void setGCType(String gcType)
      Specified by:
      setGCType in interface SegmentRevisionGC
    • startRevisionGC

      public void startRevisionGC()
      Description copied from interface: SegmentRevisionGC
      Initiate a revision garbage collection operation
      Specified by:
      startRevisionGC in interface SegmentRevisionGC
    • 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 interface SegmentRevisionGC
    • getLastCompaction

      public long getLastCompaction()
      Specified by:
      getLastCompaction in interface SegmentRevisionGC
      Returns:
      time of the last compaction in milliseconds.
    • getLastCleanup

      public long getLastCleanup()
      Specified by:
      getLastCleanup in interface SegmentRevisionGC
      Returns:
      time of the last cleanup in milliseconds.
    • getLastRepositorySize

      public long getLastRepositorySize()
      Specified by:
      getLastRepositorySize in interface SegmentRevisionGC
      Returns:
      repository size after the last cleanup.
    • getLastReclaimedSize

      public long getLastReclaimedSize()
      Specified by:
      getLastReclaimedSize in interface SegmentRevisionGC
      Returns:
      reclaimed size during the last cleanup.
    • getLastError

      @Nullable public @Nullable String getLastError()
      Specified by:
      getLastError in interface SegmentRevisionGC
      Returns:
      last error or null if none.
    • getLastLogMessage

      @NotNull public @NotNull String getLastLogMessage()
      Specified by:
      getLastLogMessage in interface SegmentRevisionGC
      Returns:
      last log message or null if none.
    • getStatus

      @NotNull public @NotNull String getStatus()
      Specified by:
      getStatus in interface SegmentRevisionGC
      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 interface SegmentRevisionGC
      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 between 0 and 100 is expected. Setting this to 0 will disable the check.
      Specified by:
      setMemoryThreshold in interface SegmentRevisionGC
    • isRevisionGCRunning

      public boolean isRevisionGCRunning()
      Specified by:
      isRevisionGCRunning in interface SegmentRevisionGC
      Returns:
      true if there is an online compaction cycle running
    • getCompactedNodes

      public long getCompactedNodes()
      Specified by:
      getCompactedNodes in interface SegmentRevisionGC
      Returns:
      number of compacted nodes in the current cycle
    • getEstimatedCompactableNodes

      public long getEstimatedCompactableNodes()
      Specified by:
      getEstimatedCompactableNodes in interface SegmentRevisionGC
      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 interface SegmentRevisionGC
      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 interface SegmentRevisionGC
      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 interface SegmentRevisionGC
      Parameters:
      gcProgressLog - number of nodes