dlmarion commented on code in PR #3555:
URL: https://github.com/apache/accumulo/pull/3555#discussion_r1251200773


##########
test/src/main/java/org/apache/accumulo/test/functional/CompactionIT.java:
##########
@@ -280,6 +292,64 @@ public void testUserCompactionCancellation() throws 
Exception {
     }
   }
 
+  @Test
+  public void testErrorDuringUserCompaction() throws Exception {
+    final String table1 = this.getUniqueNames(1)[0];
+    try (AccumuloClient client = 
Accumulo.newClient().from(getClientProps()).build()) {
+      client.tableOperations().create(table1);
+      client.tableOperations().setProperty(table1, 
Property.TABLE_FILE_MAX.getKey(), "1001");
+      client.tableOperations().setProperty(table1, 
Property.TABLE_MAJC_RATIO.getKey(), "1001");
+      TableId tid = 
TableId.of(client.tableOperations().tableIdMap().get(table1));
+
+      ReadWriteIT.ingest(client, MAX_DATA, 1, 1, 0, "colf", table1, 1);
+
+      Ample ample = ((ClientContext) client).getAmple();
+      TabletsMetadata tms = 
ample.readTablets().forTable(tid).fetch(ColumnType.FILES).build();
+      TabletMetadata tm = tms.iterator().next();
+      assertEquals(1000, tm.getFiles().size());
+
+      IteratorSetting setting = new IteratorSetting(50, "error", 
ErrorThrowingIterator.class);
+      setting.addOption(ErrorThrowingIterator.TIMES, "3");
+      client.tableOperations().attachIterator(table1, setting, 
EnumSet.of(IteratorScope.majc));
+      client.tableOperations().compact(table1, new 
CompactionConfig().setWait(true));
+
+      tms = ample.readTablets().forTable(tid).fetch(ColumnType.FILES).build();
+      tm = tms.iterator().next();
+      assertEquals(1, tm.getFiles().size());
+
+      ReadWriteIT.verify(client, MAX_DATA, 1, 1, 0, table1);
+
+    }
+  }
+
+  @Test
+  public void testSuccessfulCompactionNoOutput() throws Exception {

Review Comment:
   renamed test and added ErrorThrowingIterator. The ErrorThrowingError will 
throw an error 3 times, then allow the AgeOff filter to proceed, which will 
remove all of the data and succeed with no output.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to