You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2011/10/28 16:42:23 UTC

svn commit: r1190367 - /incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/BulkImportHelper.java

Author: ecn
Date: Fri Oct 28 14:42:23 2011
New Revision: 1190367

URL: http://svn.apache.org/viewvc?rev=1190367&view=rev
Log:
ACCUMULO-91: verify input directory and convert paths to absolute paths

Modified:
    incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/BulkImportHelper.java

Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/BulkImportHelper.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/BulkImportHelper.java?rev=1190367&r1=1190366&r2=1190367&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/BulkImportHelper.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/BulkImportHelper.java Fri Oct 28 14:42:23 2011
@@ -119,6 +119,12 @@ public class BulkImportHelper {
     
     Configuration conf = CachedConfiguration.getInstance();
     FileSystem fs = FileSystem.get(conf);
+    FileStatus status = fs.getFileStatus(dir);
+    if (status == null)
+      throw new RuntimeException(dir + " does not exist");
+    if (!status.isDir())
+      throw new RuntimeException(dir + " is not a directory");
+    dir = new Path(dir.toUri().getPath());
     
     Map<Path,MapFileInfo> mapFilesInfo = null;
     Map<KeyExtent,String> locations = null;
@@ -133,6 +139,7 @@ public class BulkImportHelper {
     }
     
     fs.mkdirs(failureDir);
+    failureDir = new Path(failureDir.toUri().getPath());
     
     ClientService.Iface client = null;
     String lockFile = null;