@InterfaceAudience.Private public class CompactionProgress extends Object
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.
Modifier and Type | Field and Description |
---|---|
long |
currentCompactedKVs
the completed count of key values in currently running compaction
|
private static org.slf4j.Logger |
LOG |
long |
totalCompactedSize
the total size of data processed by the currently running compaction, in bytes
|
private long |
totalCompactingKVs
the total compacting key values in currently running compaction
|
Constructor and Description |
---|
CompactionProgress(long totalCompactingKVs)
Constructor
|
Modifier and Type | Method and Description |
---|---|
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() |
private static final org.slf4j.Logger LOG
private long totalCompactingKVs
public long currentCompactedKVs
public long totalCompactedSize
public CompactionProgress(long totalCompactingKVs)
totalCompactingKVs
- the total Key/Value pairs to be compactedpublic float getProgressPct()
public void cancel()
public void complete()
public long getTotalCompactingKVs()
public long getCurrentCompactedKvs()
public long getTotalCompactedSize()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.