Skip to content

Commit

Permalink
Introduce compactionDropDeletedRecordCount metric.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuyaogai committed Nov 11, 2024
1 parent 7dae1ad commit 22edb4f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ public CompactResult call() throws Exception {
.map(DataFileMeta::fileSize)
.reduce(Long::sum)
.orElse(0L));
metricsReporter.reportDropDeletedRecordCount(
result.getDropDeletedRecordCount());
reportDropDeletedRecordCount(result.getDropDeletedRecordCount());
}
},
LOG);
Expand All @@ -80,6 +79,12 @@ public CompactResult call() throws Exception {
}
}

private void reportDropDeletedRecordCount(long dropDeletedRecordCount) {
if (metricsReporter != null) {
metricsReporter.reportDropDeletedRecordCount(dropDeletedRecordCount);
}
}

private void decreaseCompactionsQueuedCount() {
if (metricsReporter != null) {
metricsReporter.decreaseCompactionsQueuedCount();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/
public class DropDeleteReader implements RecordReader<KeyValue> {

private long dropDeletedRecordCount = 0L;
private long dropDeleteRecordCount = 0L;
private final RecordReader<KeyValue> reader;

public DropDeleteReader(RecordReader<KeyValue> reader) {
Expand All @@ -59,7 +59,7 @@ public KeyValue next() throws IOException {
if (kv.isAdd()) {
return kv;
}
++dropDeletedRecordCount;
++dropDeleteRecordCount;
}
}

Expand All @@ -72,7 +72,7 @@ public void releaseBatch() {

@Override
public long skippedRecordCount() {
return dropDeletedRecordCount;
return dropDeleteRecordCount;
}

@Override
Expand Down

0 comments on commit 22edb4f

Please sign in to comment.