ACCUMULO-3352 Propagate bulk import errors to client

  Provide a better message in case of failures in bulk import, and propagate
  those errors to the client, rather than swallow them on the server side, and
  forcing the client to wait indefinitely.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/52a6e977
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/52a6e977
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/52a6e977

Branch: refs/heads/master
Commit: 52a6e977fa4f4fe89e90a0f0b44dc04ef9024bb0
Parents: af957f9
Author: Christopher Tubbs <ctubb...@apache.org>
Authored: Thu Dec 18 14:32:49 2014 -0500
Committer: Christopher Tubbs <ctubb...@apache.org>
Committed: Thu Dec 18 14:32:49 2014 -0500

----------------------------------------------------------------------
 .../java/org/apache/accumulo/master/tableOps/BulkImport.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/52a6e977/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java
----------------------------------------------------------------------
diff --git 
a/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java
 
b/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java
index 10cf224..9f41920 100644
--- 
a/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java
+++ 
b/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java
@@ -189,11 +189,11 @@ public class BulkImport extends MasterRepo {
   private Path createNewBulkDir(VolumeManager fs, String tableId) throws 
IOException {
     Path tempPath = fs.matchingFileSystem(new Path(sourceDir), 
ServerConstants.getTablesDirs());
     if (tempPath == null)
-      throw new IllegalStateException(sourceDir + " is not in a known 
namespace");
+      throw new IOException(sourceDir + " is not in a volume configured for 
Accumulo");
 
     String tableDir = tempPath.toString();
     if (tableDir == null)
-      throw new IllegalStateException(sourceDir + " is not in a known 
namespace");
+      throw new IOException(sourceDir + " is not in a volume configured for 
Accumulo");
     Path directory = new Path(tableDir + "/" + tableId);
     fs.mkdirs(directory);
 
@@ -208,7 +208,7 @@ public class BulkImport extends MasterRepo {
     while (true) {
       Path newBulkDir = new Path(directory, Constants.BULK_PREFIX + 
namer.getNextName());
       if (fs.exists(newBulkDir)) // sanity check
-        throw new IllegalStateException("Dir exist when it should not " + 
newBulkDir);
+        throw new IOException("Dir exist when it should not " + newBulkDir);
       if (fs.mkdirs(newBulkDir))
         return newBulkDir;
       log.warn("Failed to create " + newBulkDir + " for unknown reason");

Reply via email to