You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2020/11/06 01:56:53 UTC

[GitHub] [accumulo] keith-turner commented on issue #1628: Add test where compaction selector sporadically throws an exception.

keith-turner commented on issue #1628:
URL: https://github.com/apache/accumulo/issues/1628#issuecomment-722759100


   @tynyttie I would add the test to the following class.
   
   https://github.com/apache/accumulo/blob/main/test/src/main/java/org/apache/accumulo/test/CompactionExecutorIT.java
   
   The test could do something like the following.  Could create BuggySelector as a static public class in CompactionExecutorIT 
   
   ```java
   @Test
   public void testBuggySelector(){
        //TODO create table bst and Accumulo client
   
       // add 3 files to table... 
       addFile(client, "bst", 1, 1000, false);
       addFile(client, "bst", 1, 500, false)
       addFile(client, "bst", 1, 250, false)
    
     // get the current files
      var files = getFiles(client, "bst");
   
      // TODO somehow select a random subset of files from above set
     randomSubset = ....
     String rsl = .... somehow join randomSubset into a comma sep list
   
     // configure compaction to use BuggySelector. BuggySelector should select the files passed in the option fileToCompact and it should sometimes randomly throw an exception.
      var cc1 = new CompactionConfig()
          .setSelector(
              new PluginConfig(BuggySelector.class.getName(), Map.of("filesToCompact", rls)))
          .setWait(true);  
      
        client.tableOperations().compact("bst", cc1);
   
        var files2 = getFiles(client, "bst");
        // TODO verify that files does not contain anything from randomSubset
   }
   
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org