DomGarguilo commented on code in PR #5930:
URL: https://github.com/apache/accumulo/pull/5930#discussion_r2388937430
##########
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:
Yea nice find. done in 755b486
--
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]