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 2013/10/23 04:42:07 UTC

[2/3] git commit: ACCUMULO-1762 fixed issues w/ offline map reduce and fully qualified paths

ACCUMULO-1762 fixed issues w/ offline map reduce and fully qualified paths


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

Branch: refs/heads/master
Commit: 388f87dc1b7472abbb053d8a3604f3444f03d2a7
Parents: 86669f7
Author: Keith Turner <kt...@apache.org>
Authored: Tue Oct 22 20:52:11 2013 -0400
Committer: Keith Turner <kt...@apache.org>
Committed: Tue Oct 22 22:40:23 2013 -0400

----------------------------------------------------------------------
 .../accumulo/core/client/impl/OfflineScanner.java     | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/388f87dc/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java b/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java
index 9f6f3cd..0231fad 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java
@@ -67,6 +67,7 @@ import org.apache.accumulo.core.util.UtilWaitThread;
 import org.apache.commons.lang.NotImplementedException;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.Text;
 
 class OfflineIterator implements Iterator<Entry<Key,Value>> {
@@ -227,13 +228,10 @@ class OfflineIterator implements Iterator<Entry<Key,Value>> {
       throw new AccumuloException(" " + currentExtent + " is not previous extent " + extent);
     
     String tablesDir = instance.getConfiguration().get(Property.INSTANCE_DFS_DIR) + "/tables";
-    String[] volumes = instance.getConfiguration().get(Property.INSTANCE_VOLUMES).split(",");
-    if (volumes.length > 1) {
-      tablesDir = volumes[0] + tablesDir;
-    }
+
     List<String> absFiles = new ArrayList<String>();
     for (String relPath : relFiles) {
-      if (relFiles.contains(":")) {
+      if (relPath.contains(":")) {
         absFiles.add(relPath);
       } else {
         // handle old-style relative paths
@@ -298,7 +296,7 @@ class OfflineIterator implements Iterator<Entry<Key,Value>> {
     
     Configuration conf = CachedConfiguration.getInstance();
     
-    FileSystem fs = FileUtil.getFileSystem(conf, instance.getConfiguration());
+    FileSystem defaultFs = FileUtil.getFileSystem(conf, instance.getConfiguration());
     
     for (SortedKeyValueIterator<Key,Value> reader : readers) {
       ((FileSKVIterator) reader).close();
@@ -308,6 +306,10 @@ class OfflineIterator implements Iterator<Entry<Key,Value>> {
     
     // TODO need to close files - ACCUMULO-1303
     for (String file : absFiles) {
+      FileSystem fs = defaultFs;
+      if (file.contains(":"))
+        fs = new Path(file).getFileSystem(conf);
+
       FileSKVIterator reader = FileOperations.getInstance().openReader(file, false, fs, conf, acuTableConf, null, null);
       readers.add(reader);
     }