keith-turner commented on code in PR #5930:
URL: https://github.com/apache/accumulo/pull/5930#discussion_r2388517656


##########
test/src/main/java/org/apache/accumulo/test/functional/BulkNewIT.java:
##########
@@ -206,6 +217,108 @@ public void testSingleTabletSingleFile() throws Exception 
{
     }
   }
 
+  @Test
+  public void testConcurrentImportSameDirectory() throws Exception {
+    try (AccumuloClient client = 
Accumulo.newClient().from(getClientProps()).build()) {
+      final int numTasks = 16;
+      final int iterations = 3;
+      final int startRow = 0;
+      final int endRow = 199;
+
+      ExecutorService pool = Executors.newFixedThreadPool(numTasks);
+
+      try {
+        for (int i = 0; i < iterations; i++) {
+          LOG.debug("Running concurrent import iteration {}/{}", i + 1, 
iterations);
+          final String table = getUniqueNames(1)[0] + i;
+          client.tableOperations().create(table);
+
+          Path sourceDir = new Path(rootPath + "/concurrent/" + table + 
"_sourceDir");
+          assertTrue(fs.mkdirs(sourceDir), "Failed to create " + sourceDir);
+
+          writeData(fs, sourceDir + "/f.", aconf, startRow, endRow);
+
+          CountDownLatch startSignal = new CountDownLatch(numTasks);
+          List<Future<Boolean>> futures = new ArrayList<>(numTasks);
+          Predicate<Throwable> expectedConcurrentFailure = throwable -> {

Review Comment:
   Looking at the declaration of [this 
method](https://github.com/apache/accumulo/blob/f2cd46bd9a65527ee90ad0aa1d13a4880c1e1ff7/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java#L690)
 the checked exceptions that would be expected for this case are 
AccumuloException and IOException (would not expect the other 2 checked 
exceptions).  So wondering if this predicated could be simiplified to 
   
   ```java
   Predicate<Throwable> expectedConcurrentFailure = throwable -> {
      return throwable instanceof IOException || throwable instanceof 
AccumuloException;
   };
   ```



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