You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by kt...@apache.org on 2019/05/16 18:44:03 UTC

[accumulo] branch master updated: Ref #1084 Fixes File not Found Error (#1162)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 3cf6b71  Ref #1084 Fixes File not Found Error (#1162)
3cf6b71 is described below

commit 3cf6b71b8e96f8b4f1a3a645088b45cc3e66f568
Author: Jeffrey Manno <je...@gmail.com>
AuthorDate: Thu May 16 14:43:57 2019 -0400

    Ref #1084 Fixes File not Found Error (#1162)
---
 .../src/main/java/org/apache/accumulo/test/BulkImportVolumeIT.java | 7 ++++++-
 test/src/main/java/org/apache/accumulo/test/ImportExportIT.java    | 6 +++++-
 .../main/java/org/apache/accumulo/test/functional/BulkFileIT.java  | 4 ++--
 test/src/main/java/org/apache/accumulo/test/functional/BulkIT.java | 6 ++++--
 .../apache/accumulo/test/functional/BulkSplitOptimizationIT.java   | 3 ++-
 .../java/org/apache/accumulo/test/functional/CompactionIT.java     | 4 +++-
 6 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/test/src/main/java/org/apache/accumulo/test/BulkImportVolumeIT.java b/test/src/main/java/org/apache/accumulo/test/BulkImportVolumeIT.java
index 65a6826..9e13eae 100644
--- a/test/src/main/java/org/apache/accumulo/test/BulkImportVolumeIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/BulkImportVolumeIT.java
@@ -70,20 +70,25 @@ public class BulkImportVolumeIT extends AccumuloClusterHarness {
     try (AccumuloClient client = Accumulo.newClient().from(getClientProps()).build()) {
       client.tableOperations().create(tableName);
       FileSystem fs = getFileSystem();
-      Path rootPath = new Path(cluster.getTemporaryPath(), getClass().getName());
+      Path rootPath = new Path(fs.getUri().toString() + cluster.getTemporaryPath(), getClass().getName());
+      fs.deleteOnExit(rootPath);
+
       Path bulk = new Path(rootPath, "bulk");
+      fs.deleteOnExit(bulk);
       log.info("bulk: {}", bulk);
       if (fs.exists(bulk)) {
         fs.delete(bulk, true);
       }
       assertTrue(fs.mkdirs(bulk));
       Path err = new Path(rootPath, "err");
+      fs.deleteOnExit(err);
       log.info("err: {}", err);
       if (fs.exists(err)) {
         fs.delete(err, true);
       }
       assertTrue(fs.mkdirs(err));
       Path bogus = new Path(bulk, "bogus.rf");
+      fs.deleteOnExit(bogus);
       fs.create(bogus).close();
       log.info("bogus: {}", bogus);
       assertTrue(fs.exists(bogus));
diff --git a/test/src/main/java/org/apache/accumulo/test/ImportExportIT.java b/test/src/main/java/org/apache/accumulo/test/ImportExportIT.java
index b8e7c50..d4ffc27 100644
--- a/test/src/main/java/org/apache/accumulo/test/ImportExportIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ImportExportIT.java
@@ -92,7 +92,8 @@ public class ImportExportIT extends AccumuloClusterHarness {
       FileSystem fs = cluster.getFileSystem();
       Path tmp = cluster.getTemporaryPath();
       log.info("Using FileSystem: " + fs);
-      Path baseDir = new Path(tmp, getClass().getName());
+      Path baseDir = new Path(fs.getUri().toString() + tmp, getClass().getName());
+      fs.deleteOnExit(baseDir);
       if (fs.exists(baseDir)) {
         log.info("{} exists on filesystem, deleting", baseDir);
         assertTrue("Failed to deleted " + baseDir, fs.delete(baseDir, true));
@@ -100,7 +101,9 @@ public class ImportExportIT extends AccumuloClusterHarness {
       log.info("Creating {}", baseDir);
       assertTrue("Failed to create " + baseDir, fs.mkdirs(baseDir));
       Path exportDir = new Path(baseDir, "export");
+      fs.deleteOnExit(exportDir);
       Path importDir = new Path(baseDir, "import");
+      fs.deleteOnExit(importDir);
       for (Path p : new Path[] {exportDir, importDir}) {
         assertTrue("Failed to create " + baseDir, fs.mkdirs(p));
       }
@@ -115,6 +118,7 @@ public class ImportExportIT extends AccumuloClusterHarness {
 
       // Make sure the distcp.txt file that exporttable creates is available
       Path distcp = new Path(exportDir, "distcp.txt");
+      fs.deleteOnExit(distcp);
       assertTrue("Distcp file doesn't exist", fs.exists(distcp));
       FSDataInputStream is = fs.open(distcp);
       BufferedReader reader = new BufferedReader(new InputStreamReader(is));
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/BulkFileIT.java b/test/src/main/java/org/apache/accumulo/test/functional/BulkFileIT.java
index f6b80a8..cd7e870 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/BulkFileIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/BulkFileIT.java
@@ -74,8 +74,7 @@ public class BulkFileIT extends AccumuloClusterHarness {
       Configuration conf = new Configuration();
       AccumuloConfiguration aconf = getCluster().getServerContext().getConfiguration();
       FileSystem fs = getCluster().getFileSystem();
-
-      String rootPath = cluster.getTemporaryPath().toString();
+      String rootPath = fs.getUri().toString()  + cluster.getTemporaryPath().toString();
 
       String dir = rootPath + "/bulk_test_diff_files_89723987592_" + getUniqueNames(1)[0];
 
@@ -89,6 +88,7 @@ public class BulkFileIT extends AccumuloClusterHarness {
       Path failPath = new Path(failDir);
       fs.delete(failPath, true);
       fs.mkdirs(failPath);
+      fs.deleteOnExit(failPath);
 
       // Ensure server can read/modify files
       c.tableOperations().importDirectory(tableName, dir, failDir, false);
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/BulkIT.java b/test/src/main/java/org/apache/accumulo/test/functional/BulkIT.java
index 71fb322..ec7fcf7 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/BulkIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/BulkIT.java
@@ -64,12 +64,14 @@ public class BulkIT extends AccumuloClusterHarness {
   static void runTest(AccumuloClient c, ClientInfo info, FileSystem fs, Path basePath,
       String tableName, String filePrefix, String dirSuffix, boolean useOld) throws Exception {
     c.tableOperations().create(tableName);
-
-    Path base = new Path(basePath, "testBulkFail_" + dirSuffix);
+    Path base = new Path(fs.getUri().toString() + basePath, "testBulkFail_" + dirSuffix);
     fs.delete(base, true);
     fs.mkdirs(base);
+    fs.deleteOnExit(base);
     Path bulkFailures = new Path(base, "failures");
+    fs.deleteOnExit(bulkFailures);
     Path files = new Path(base, "files");
+    fs.deleteOnExit(files);
     fs.mkdirs(bulkFailures);
     fs.mkdirs(files);
 
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java b/test/src/main/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java
index e785bbe..29e78bd 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java
@@ -90,7 +90,8 @@ public class BulkSplitOptimizationIT extends AccumuloClusterHarness {
       c.tableOperations().setProperty(tableName, Property.TABLE_FILE_MAX.getKey(), "1000");
       c.tableOperations().setProperty(tableName, Property.TABLE_SPLIT_THRESHOLD.getKey(), "1G");
       FileSystem fs = cluster.getFileSystem();
-      Path testDir = new Path(getUsableDir(), "testmf");
+      Path testDir = new Path(fs.getUri().toString() + getUsableDir(), "testmf");
+      fs.deleteOnExit(testDir);
       FunctionalTestUtils.createRFiles(c, fs, testDir.toString(), ROWS, SPLITS, 8);
       FileStatus[] stats = fs.listStatus(testDir);
 
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/CompactionIT.java b/test/src/main/java/org/apache/accumulo/test/functional/CompactionIT.java
index 0a06a2c..debee5a 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/CompactionIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/CompactionIT.java
@@ -115,8 +115,10 @@ public class CompactionIT extends AccumuloClusterHarness {
       c.tableOperations().create(tableName);
       c.tableOperations().setProperty(tableName, Property.TABLE_MAJC_RATIO.getKey(), "1.0");
       FileSystem fs = getFileSystem();
-      Path root = new Path(cluster.getTemporaryPath(), getClass().getName());
+      Path root = new Path(fs.getUri().toString() + cluster.getTemporaryPath(), getClass().getName());
+      fs.deleteOnExit(root);
       Path testrf = new Path(root, "testrf");
+      fs.deleteOnExit(testrf);
       FunctionalTestUtils.createRFiles(c, fs, testrf.toString(), 500000, 59, 4);
 
       c.tableOperations().importDirectory(testrf.toString()).to(tableName).load();