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 2019/11/22 21:28:37 UTC

[GitHub] [accumulo] keith-turner commented on a change in pull request #1441: Improve Upgrader9to10 code

keith-turner commented on a change in pull request #1441: Improve Upgrader9to10 code
URL: https://github.com/apache/accumulo/pull/1441#discussion_r349797431
 
 

 ##########
 File path: test/src/main/java/org/apache/accumulo/test/upgrade/GCUpgrade9to10TestIT.java
 ##########
 @@ -118,38 +113,70 @@ public void gcUpgradeNoDeletesIT() throws Exception {
   }
 
   /**
-   * This is really hard to make happen - the minicluster can only use so little memory to start up.
-   * The {@link org.apache.accumulo.master.upgrade.Upgrader9to10} CANDIDATE_MEMORY_PERCENTAGE can be
-   * adjusted.
+   * Ensure that the size of the candidates exceeds the {@link Upgrader9to10}'s CANDIDATE_BATCH_SIZE
+   * and will clean up candidates in multiple batches, without running out of memory.
    */
   @Test
   public void gcUpgradeOutofMemoryTest() throws Exception {
     killMacGc(); // we do not want anything deleted
 
-    int somebignumber = 100000;
-    String longpathname = "aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeee"
-        + "ffffffffffgggggggggghhhhhhhhhhiiiiiiiiiijjjjjjjjjj"
-        + "kkkkkkkkkkkkkkkkkklllllllllllllllllllllmmmmmmmmmmmmmmmmmnnnnnnnnnnnnnnnn";
-    longpathname += longpathname; // make it even longer
+    int numberOfEntries = 100_000;
+    String longpathname = StringUtils.repeat("abcde", 100);
+    assertEquals(500, longpathname.length());
+
+    // dynamically get the batch size from the other class
+    Field CANDIDATE_BATCH_SIZE_field = Upgrader9to10.class.getDeclaredField("CANDIDATE_BATCH_SIZE");
 
 Review comment:
   Could make the field public.

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


With regards,
Apache Git Services