This is an automated email from the ASF dual-hosted git repository.

ctubbsii pushed a commit to branch 2.1
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/2.1 by this push:
     new 43df0b1db4 adds bulk import v1 to ScanConsistencyIT (#3672)
43df0b1db4 is described below

commit 43df0b1db435dd9d3a741608088f1614feda0046
Author: Keith Turner <[email protected]>
AuthorDate: Tue Aug 1 23:08:53 2023 -0400

    adds bulk import v1 to ScanConsistencyIT (#3672)
---
 .../org/apache/accumulo/test/ScanConsistencyIT.java | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/test/src/main/java/org/apache/accumulo/test/ScanConsistencyIT.java 
b/test/src/main/java/org/apache/accumulo/test/ScanConsistencyIT.java
index bdf67a2e4c..752d7c6a79 100644
--- a/test/src/main/java/org/apache/accumulo/test/ScanConsistencyIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ScanConsistencyIT.java
@@ -445,13 +445,16 @@ public class ScanConsistencyIT extends 
AccumuloClusterHarness {
       this.tctx = testContext;
     }
 
+    @SuppressWarnings("deprecation")
     private long bulkImport(Random random, Collection<Mutation> mutations) 
throws Exception {
 
       if (mutations.isEmpty()) {
         return 0;
       }
 
-      Path bulkDir = new Path(tctx.tmpDir + "/bulkimport_" + 
nextLongAbs(random));
+      String name = "/bulkimport_" + nextLongAbs(random);
+      Path bulkDir = new Path(tctx.tmpDir + name);
+      Path failDir = new Path(tctx.tmpDir + name + "_failures");
 
       List<Key> keys = 
mutations.stream().flatMap(ScanConsistencyIT::toKeys).sorted()
           .collect(Collectors.toList());
@@ -467,10 +470,22 @@ public class ScanConsistencyIT extends 
AccumuloClusterHarness {
           }
         }
 
-        
tctx.client.tableOperations().importDirectory(bulkDir.toString()).to(tctx.table)
-            .tableTime(true).load();
+        if (random.nextBoolean()) {
+          // use bulk import v1
+          tctx.fileSystem.mkdirs(failDir);
+          tctx.client.tableOperations().importDirectory(tctx.table, 
bulkDir.toString(),
+              failDir.toString(), true);
+          assertEquals(0, tctx.fileSystem.listStatus(failDir).length,
+              "Failure dir was not empty " + failDir);
+        } else {
+          // use bulk import v2
+          
tctx.client.tableOperations().importDirectory(bulkDir.toString()).to(tctx.table)
+              .tableTime(true).load();
+        }
+
       } finally {
         tctx.fileSystem.delete(bulkDir, true);
+        tctx.fileSystem.delete(failDir, true);
       }
 
       return keys.size();

Reply via email to