You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2015/05/29 03:28:56 UTC

[08/11] accumulo git commit: ACCUMULO-3869 Explicitly ensure null object was not returned

ACCUMULO-3869 Explicitly ensure null object was not returned


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

Branch: refs/heads/master
Commit: 1ad4bfa0905b12e7ba2a5d2cc7d47d5130a78e7f
Parents: 7432c5c
Author: Josh Elser <el...@apache.org>
Authored: Thu May 28 20:15:32 2015 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Thu May 28 21:14:19 2015 -0400

----------------------------------------------------------------------
 .../org/apache/accumulo/master/tableOps/CreateImportDir.java     | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/1ad4bfa0/server/master/src/main/java/org/apache/accumulo/master/tableOps/CreateImportDir.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/tableOps/CreateImportDir.java b/server/master/src/main/java/org/apache/accumulo/master/tableOps/CreateImportDir.java
index 69dcc49..cb70c68 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/CreateImportDir.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/CreateImportDir.java
@@ -48,6 +48,10 @@ class CreateImportDir extends MasterRepo {
     log.info("Looking for matching filesystem for " + exportDir + " from options " + Arrays.toString(tableDirs));
     Path base = master.getFileSystem().matchingFileSystem(exportDir, tableDirs);
     log.info("Chose base table directory of " + base);
+    // Sanity check that a valid FileSystem was found for the exportDir
+    if (null == base) {
+      throw new RuntimeException("Could not determine matching FileSystem for " + exportDir);
+    }
     Path directory = new Path(base, tableInfo.tableId);
 
     Path newBulkDir = new Path(directory, Constants.BULK_PREFIX + namer.getNextName());