@@ -644,21 +644,24 @@ public String call() throws Exception {
644
644
// 1 in 20 chance of doing a filter compaction. This compaction will delete a data set.
645
645
var deletes = tctx .dataTracker .getDeletes ();
646
646
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
+ }
662
665
}
663
666
}
664
667
0 commit comments