Source:
protected boolean performCompaction(Compactor.FileDetails fd, InternalScanner scanner, CellSink writer, long smallestReadPoint, boolean cleanSeqId, ThroughputController throughputController, boolean major, int numofFilesToCompact) throws IOException { SpliceLogUtils.trace(LOG,"performCompaction"); long bytesWritten = 0; final long closeCheckInterval = HStore.getCloseCheckInterval(); long bytesWrittenProgress = 0, lastMillis = 0, now = 0; if (LOG.isDebugEnabled()) { lastMillis = EnvironmentEdgeManager.currentTime(); } List<Cell> cells = new ArrayList<>(); boolean hasMore; ScannerContext scannerContext = ScannerContext.newBuilder().setBatchLimit(compactionKVMax).build(); do { hasMore = scanner.next(cells, scannerContext); if (LOG.isDebugEnabled()) { now = EnvironmentEdgeManager.currentTime(); } for (Cell c : cells) { if (cleanSeqId && c.getSequenceId() <= smallestReadPoint) { CellUtil.setSequenceId(c, 0); } writer.append(c); long len = 0; if(scanner instanceof AbstractSICompactionScanner) { len = ((AbstractSICompactionScanner)scanner).getSize(); } else { len = KeyValueUtil.length(c); } ++progress.currentCompactedKVs; progress.totalCompactedSize += len; if (LOG.isDebugEnabled()) { bytesWrittenProgress += len; } if (closeCheckInterval > 0) { bytesWritten += len; if (bytesWritten > closeCheckInterval) { bytesWritten = 0; if (!store.areWritesEnabled()) { LOG.debug("Compaction cancelled"); progress.cancel(); return false; } } } } if (LOG.isDebugEnabled()) { if ((now - lastMillis) >= 60 * 1000) { LOG.debug(String.format("Compaction progress: %s, rate=%.2f kB/sec", progress.toString(), (bytesWrittenProgress / 1024.0) / ((now - lastMillis) / 1000.0))); lastMillis = now; bytesWrittenProgress = 0; } } cells.clear(); } while (hasMore); progress.complete(); return true; }

Target:
protected boolean performCompaction(Compactor.FileDetails fd, InternalScanner scanner, CellSink writer, long smallestReadPoint, boolean cleanSeqId, ThroughputController throughputController, boolean major, int numofFilesToCompact) throws IOException { SpliceLogUtils.trace(LOG, "performCompaction"); long bytesWritten = 0; final long closeCheckInterval = HStore.getCloseCheckInterval(); long bytesWrittenProgress = 0, lastMillis = 0, now = 0; if (LOG.isDebugEnabled()) { lastMillis = EnvironmentEdgeManager.currentTime(); } List<Cell> cells = new ArrayList<>(); boolean hasMore; ScannerContext scannerContext = ScannerContext.newBuilder().setBatchLimit(compactionKVMax).build(); do { hasMore = scanner.next(cells, scannerContext); if (LOG.isDebugEnabled()) { now = EnvironmentEdgeManager.currentTime(); } for (Cell c : cells) { if (cleanSeqId && c.getSequenceId() <= smallestReadPoint) { CellUtil.setSequenceId(c, 0); } writer.append(c); long len = 0; if (scanner instanceof AbstractSICompactionScanner) { len = ((AbstractSICompactionScanner) scanner).numberOfScannedBytes(); } else { len = KeyValueUtil.length(c); } ++progress.currentCompactedKVs; progress.totalCompactedSize += len; if (LOG.isDebugEnabled()) { bytesWrittenProgress += len; } if (closeCheckInterval > 0) { bytesWritten += len; if (bytesWritten > closeCheckInterval) { bytesWritten = 0; if ((isSpark && TaskContext.get().isInterrupted()) || (!isSpark && !store.areWritesEnabled())) { SpliceLogUtils.debug(LOG, "Compaction cancelled"); progress.cancel(); return false; } } } } if (LOG.isDebugEnabled()) { if ((now - lastMillis) >= 60 * 1000) { LOG.debug(String.format("Compaction progress: %s, rate=%.2f kB/sec", progress, (bytesWrittenProgress / 1024.0) / ((now - lastMillis) / 1000.0))); lastMillis = now; bytesWrittenProgress = 0; } } cells.clear(); } while (hasMore); progress.complete(); return true; }