incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1190367 - /incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/BulkImportHelper.java
Date Fri, 28 Oct 2011 14:42:23 GMT
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;



Mime
View raw message