accumulo icon indicating copy to clipboard operation
accumulo copied to clipboard

Improve validation in TabletManagementIteratorIT

Open keith-turner opened this issue 11 months ago • 1 comments

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));

keith-turner avatar Mar 07 '24 15:03 keith-turner

I can take a look at this

ArbaazKhan1 avatar Mar 13 '24 20:03 ArbaazKhan1

Closed by #4418

dlmarion avatar May 28 '24 18:05 dlmarion