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/07/18 03:08:51 UTC

[GitHub] [accumulo] keith-turner commented on a change in pull request #1649: Addresses four compaction service follow on issues.

keith-turner commented on a change in pull request #1649:
URL: https://github.com/apache/accumulo/pull/1649#discussion_r456741075



##########
File path: test/src/main/java/org/apache/accumulo/test/CompactionRateLimitingIT.java
##########
@@ -37,50 +40,74 @@
   public static final long BYTES_TO_WRITE = 10 * 1024 * 1024;
   public static final long RATE = 1 * 1024 * 1024;
 
+  protected Property getThroughputProp() {
+    return Property.TSERV_COMPACTION_SERVICE_DEFAULT_THROUGHPUT;
+  }
+
   @Override
   public void configure(MiniAccumuloConfigImpl cfg, Configuration fsConf) {
-    cfg.setProperty(Property.TSERV_MAJC_THROUGHPUT, RATE + "B");
+    cfg.setProperty(getThroughputProp(), RATE + "B");
     cfg.setProperty(Property.TABLE_MAJC_RATIO, "20");
     cfg.setProperty(Property.TABLE_FILE_COMPRESSION_TYPE, "none");
+
+    cfg.setProperty("tserver.compaction.major.service.test.throughput", RATE + "B");
+    cfg.setProperty("tserver.compaction.major.service.test.planner",
+        DefaultCompactionPlanner.class.getName());
+    cfg.setProperty("tserver.compaction.major.service.test.planner.opts.executors",
+        "[{'name':'all','numThreads':2}]".replaceAll("'", "\""));
+
   }
 
   @Test
   public void majorCompactionsAreRateLimited() throws Exception {
     long bytesWritten = 0;
-    String tableName = getUniqueNames(1)[0];
-    AccumuloClient client =
-        getCluster().createAccumuloClient("root", new PasswordToken(ROOT_PASSWORD));
-    client.tableOperations().create(tableName);
-    try (BatchWriter bw = client.createBatchWriter(tableName)) {
-      Random r = new SecureRandom();
-      while (bytesWritten < BYTES_TO_WRITE) {
-        byte[] rowKey = new byte[32];
-        r.nextBytes(rowKey);
-
-        byte[] qual = new byte[32];
-        r.nextBytes(qual);
-
-        byte[] value = new byte[1024];
-        r.nextBytes(value);
-
-        Mutation m = new Mutation(rowKey);
-        m.put(new byte[0], qual, value);
-        bw.addMutation(m);
-
-        bytesWritten += rowKey.length + qual.length + value.length;
+    String[] tableNames = getUniqueNames(1);
+
+    try (AccumuloClient client =
+        getCluster().createAccumuloClient("root", new PasswordToken(ROOT_PASSWORD))) {
+
+      for (int i = 0; i < tableNames.length; i++) {
+        String tableName = tableNames[i];
+
+        NewTableConfiguration ntc = new NewTableConfiguration();
+        if (i == 1) {
+          ntc.setProperties(Map.of("table.compaction.dispatcher.opts.service", "test"));
+        }
+
+        client.tableOperations().create(tableName, ntc);
+        try (BatchWriter bw = client.createBatchWriter(tableName)) {
+          Random r = new SecureRandom();
+          while (bytesWritten < BYTES_TO_WRITE) {
+            byte[] rowKey = new byte[32];
+            r.nextBytes(rowKey);
+
+            byte[] qual = new byte[32];
+            r.nextBytes(qual);
+
+            byte[] value = new byte[1024];
+            r.nextBytes(value);
+
+            Mutation m = new Mutation(rowKey);
+            m.put(new byte[0], qual, value);
+            bw.addMutation(m);
+
+            bytesWritten += rowKey.length + qual.length + value.length;
+          }
+        }
+
+        client.tableOperations().flush(tableName, null, null, true);
+
+        long compactionStart = System.currentTimeMillis();
+        client.tableOperations().compact(tableName, null, null, false, true);
+        long duration = System.currentTimeMillis() - compactionStart;
+        // The rate will be "bursty", try to account for that by taking 80% of the expected rate
+        // (allow
+        // for 20% under the maximum expected duration)

Review comment:
       fixed in abc961a




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