accumulo
accumulo copied to clipboard
Improve validation in TabletManagementIteratorIT
TabletManagementIteratorIT has a method int findTabletsNeedingAttention((...)
that returns the number of tablets the iterator found. The test could be improved to do more in depth validation of the data returned by the iterator than a count. It could verify the expected tablets were returned and the expected management actions for those tablets were returned. One possible way to do this is to change the return type of the method to the following where it returns the tablets found and the management actions seen.
Map<KeyExtent, Set<ManagementAction>> findTabletsNeedingAttention(AccumuloClient client, String table,
TabletManagementParameters tabletMgmtParams) throws TableNotFoundException, IOException {
Then the test code that calls the above method could do something like the following.
KeyExtent tablet5 = null; //TODO
// because tablet5 has walogs, its expected that it would need recovery
Map<KeyExtent, Set<ManagementAction>> expected = Map.of(tablet5, Set.of(ManagementAction.NEEDS_RECOVERY));
assertEquals(expected, findTabletsNeedingAttention(client, metaCopy4, tabletMgmtParams));
I can take a look at this
Closed by #4418