if (CompactionBound.UNLIMITED == bound) {
compationBound = HConstants.LATEST_TIMESTAMP;
} else if (CompactionBound.TX_UPPER_VISIBILITY_BOUND == bound) {</BUG>
TransactionSnapshot snapshot = cache.getLatestState();
<BUG>compationBound = snapshot != null ? snapshot.getVisibilityUpperBound() : 0;

} else {
compationBound = 0;
}
return compationBound;</BUG>
}

public InternalScanner preCompact(ObserverContext<RegionCoprocessorEnvironment> e, Store store,
InternalScanner scanner, ScanType scanType) throws IOException {
return new IncrementSummingScanner(region, BATCH_UNLIMITED, scanner, scanType, getCompactionBound(store));
