Skip to content

Commit

Permalink
Merge branch 'main' into elasticity
Browse files Browse the repository at this point in the history
  • Loading branch information
keith-turner committed Feb 22, 2024
2 parents a4af4f0 + 9ffc450 commit 58be770
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions test/src/main/java/org/apache/accumulo/test/ScanConsistencyIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -679,21 +679,24 @@ public String call() throws Exception {
// 1 in 20 chance of doing a filter compaction. This compaction will delete a data set.
var deletes = tctx.dataTracker.getDeletes();

// The row has the format <random long>:<generation>, the following gets the generations
// from the rows. Expect the generation to be the same for a set of data to delete.
String gen = deletes.stream().map(m -> new String(m.getRow(), UTF_8))
.map(row -> row.split(":")[1]).distinct().collect(MoreCollectors.onlyElement());

IteratorSetting iterSetting =
new IteratorSetting(100, "genfilter", GenerationFilter.class);
iterSetting.addOptions(Map.of("generation", gen));

// run a compaction that deletes every key with the specified generation. Must wait on the
// compaction because at the end of the test it will try to verify deleted data is not
// present. Must flush the table in case data to delete is still in memory.
tctx.client.tableOperations().compact(tctx.table, new CompactionConfig().setFlush(true)
.setWait(true).setIterators(List.of(iterSetting)));
numFilters++;
if (!deletes.isEmpty()) {
// The row has the format <random long>:<generation>, the following gets the generations
// from the rows. Expect the generation to be the same for a set of data to delete.
String gen = deletes.stream().map(m -> new String(m.getRow(), UTF_8))
.map(row -> row.split(":")[1]).distinct().collect(MoreCollectors.onlyElement());

IteratorSetting iterSetting =
new IteratorSetting(100, "genfilter", GenerationFilter.class);
iterSetting.addOptions(Map.of("generation", gen));

// run a compaction that deletes every key with the specified generation. Must wait on
// the
// compaction because at the end of the test it will try to verify deleted data is not
// present. Must flush the table in case data to delete is still in memory.
tctx.client.tableOperations().compact(tctx.table, new CompactionConfig().setFlush(true)
.setWait(true).setIterators(List.of(iterSetting)));
numFilters++;
}
}
}

Expand Down

0 comments on commit 58be770

Please sign in to comment.