Skip to content

Commit 9ffc450

Browse files
committed
Merge branch '2.1'
2 parents 9deb242 + 1a40aee commit 9ffc450

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

test/src/main/java/org/apache/accumulo/test/ScanConsistencyIT.java

+18-15
Original file line numberDiff line numberDiff line change
@@ -644,21 +644,24 @@ public String call() throws Exception {
644644
// 1 in 20 chance of doing a filter compaction. This compaction will delete a data set.
645645
var deletes = tctx.dataTracker.getDeletes();
646646

647-
// The row has the format <random long>:<generation>, the following gets the generations
648-
// from the rows. Expect the generation to be the same for a set of data to delete.
649-
String gen = deletes.stream().map(m -> new String(m.getRow(), UTF_8))
650-
.map(row -> row.split(":")[1]).distinct().collect(MoreCollectors.onlyElement());
651-
652-
IteratorSetting iterSetting =
653-
new IteratorSetting(100, "genfilter", GenerationFilter.class);
654-
iterSetting.addOptions(Map.of("generation", gen));
655-
656-
// run a compaction that deletes every key with the specified generation. Must wait on the
657-
// compaction because at the end of the test it will try to verify deleted data is not
658-
// present. Must flush the table in case data to delete is still in memory.
659-
tctx.client.tableOperations().compact(tctx.table, new CompactionConfig().setFlush(true)
660-
.setWait(true).setIterators(List.of(iterSetting)));
661-
numFilters++;
647+
if (!deletes.isEmpty()) {
648+
// The row has the format <random long>:<generation>, the following gets the generations
649+
// from the rows. Expect the generation to be the same for a set of data to delete.
650+
String gen = deletes.stream().map(m -> new String(m.getRow(), UTF_8))
651+
.map(row -> row.split(":")[1]).distinct().collect(MoreCollectors.onlyElement());
652+
653+
IteratorSetting iterSetting =
654+
new IteratorSetting(100, "genfilter", GenerationFilter.class);
655+
iterSetting.addOptions(Map.of("generation", gen));
656+
657+
// run a compaction that deletes every key with the specified generation. Must wait on
658+
// the
659+
// compaction because at the end of the test it will try to verify deleted data is not
660+
// present. Must flush the table in case data to delete is still in memory.
661+
tctx.client.tableOperations().compact(tctx.table, new CompactionConfig().setFlush(true)
662+
.setWait(true).setIterators(List.of(iterSetting)));
663+
numFilters++;
664+
}
662665
}
663666
}
664667

0 commit comments

Comments
 (0)