Class CompactionProgress

java.lang.Object
org.apache.hadoop.hbase.regionserver.compactions.CompactionProgress

@Private public class CompactionProgress extends Object
This class holds information relevant for tracking the progress of a compaction.

The metrics tracked allow one to calculate the percent completion of the compaction based on the number of Key/Value pairs already compacted vs. total amount scheduled to be compacted.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    long
    the completed count of key values in currently running compaction
    private static final org.slf4j.Logger
     
    long
    the total size of data processed by the currently running compaction, in bytes
    long
    the total compacting key values in currently running compaction
  • Constructor Summary

    Constructors
    Constructor
    Description
    CompactionProgress(long totalCompactingKVs)
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Cancels the compaction progress, setting things to 0.
    void
    Marks the compaction as complete by setting total to current KV count; Total KV count is an estimate, so there might be a discrepancy otherwise.
    long
    Returns the completed count of key values in currently running compaction
    float
    getter for calculated percent complete
    long
    Returns the total data size processed by the currently running compaction, in bytes
    long
    Returns the total compacting key values in currently running compaction
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
    • totalCompactingKVs

      public long totalCompactingKVs
      the total compacting key values in currently running compaction
    • currentCompactedKVs

      public long currentCompactedKVs
      the completed count of key values in currently running compaction
    • totalCompactedSize

      public long totalCompactedSize
      the total size of data processed by the currently running compaction, in bytes
  • Constructor Details

    • CompactionProgress

      public CompactionProgress(long totalCompactingKVs)
      Constructor
      Parameters:
      totalCompactingKVs - the total Key/Value pairs to be compacted
  • Method Details

    • getProgressPct

      public float getProgressPct()
      getter for calculated percent complete
    • cancel

      public void cancel()
      Cancels the compaction progress, setting things to 0.
    • complete

      public void complete()
      Marks the compaction as complete by setting total to current KV count; Total KV count is an estimate, so there might be a discrepancy otherwise.
    • getTotalCompactingKVs

      public long getTotalCompactingKVs()
      Returns the total compacting key values in currently running compaction
    • getCurrentCompactedKvs

      public long getCurrentCompactedKvs()
      Returns the completed count of key values in currently running compaction
    • getTotalCompactedSize

      public long getTotalCompactedSize()
      Returns the total data size processed by the currently running compaction, in bytes
    • toString

      public String toString()
      Overrides:
      toString in class Object