org.apache.hadoop.hbase.regionserver.compactions
Class CompactionProgress

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

@InterfaceAudience.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
 long currentCompactedKVs
          the completed count of key values in currently running compaction
 long totalCompactedSize
          the total size of data processed by the currently running compaction, in bytes
 long totalCompactingKVs
          the total compacting key values in currently running compaction
 
Constructor Summary
CompactionProgress(long totalCompactingKVs)
          Constructor
 
Method Summary
 void cancel()
          Cancels the compaction progress, setting things to 0.
 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.
 long getCurrentCompactedKvs()
           
 float getProgressPct()
          getter for calculated percent complete
 long getTotalCompactedSize()
           
 long getTotalCompactingKvs()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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 Detail

CompactionProgress

public CompactionProgress(long totalCompactingKVs)
Constructor

Parameters:
totalCompactingKVs - the total Key/Value pairs to be compacted
Method Detail

getProgressPct

public float getProgressPct()
getter for calculated percent complete

Returns:
float

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


Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.