accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject git commit: ACCUMULO-1763 modified rfile printinfo to handle fully qualified paths
Date Tue, 22 Oct 2013 19:36:25 GMT
Updated Branches:
  refs/heads/master aceb5fbea -> 7f4449e4e


ACCUMULO-1763 modified rfile printinfo to handle 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/7f4449e4
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/7f4449e4
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/7f4449e4

Branch: refs/heads/master
Commit: 7f4449e4e05b65370a04b8b3ab3c3f5e9f331947
Parents: aceb5fb
Author: Keith Turner <kturner@apache.org>
Authored: Tue Oct 22 15:34:56 2013 -0400
Committer: Keith Turner <kturner@apache.org>
Committed: Tue Oct 22 15:35:37 2013 -0400

----------------------------------------------------------------------
 .../java/org/apache/accumulo/core/file/rfile/PrintInfo.java | 9 +++++++--
 .../apache/accumulo/core/file/rfile/bcfile/PrintInfo.java   | 6 +++++-
 2 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/7f4449e4/core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
index e23ca0b..0dfda0d 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
@@ -47,6 +47,7 @@ public class PrintInfo {
   
   public static void main(String[] args) throws Exception {
     Configuration conf = new Configuration();
+
     @SuppressWarnings("deprecation")
     FileSystem hadoopFs = FileUtil.getFileSystem(conf, AccumuloConfiguration.getSiteConfiguration());
     FileSystem localFs  = FileSystem.getLocal(conf);
@@ -62,9 +63,13 @@ public class PrintInfo {
     long totalSize = 0;
     
     for (String arg : opts.files) {
-      
       Path path = new Path(arg);
-      FileSystem fs = hadoopFs.exists(path) ? hadoopFs : localFs; // fall back to local
+      FileSystem fs;
+      if (arg.contains(":"))
+        fs = path.getFileSystem(conf);
+      else
+        fs = hadoopFs.exists(path) ? hadoopFs : localFs; // fall back to local
+      
       CachableBlockFile.Reader _rdr = new CachableBlockFile.Reader(fs, path, conf, null,
null);
       Reader iter = new RFile.Reader(_rdr);
       

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7f4449e4/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/PrintInfo.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/PrintInfo.java
b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/PrintInfo.java
index 7aba4d3..a7464c6 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/PrintInfo.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/PrintInfo.java
@@ -59,7 +59,11 @@ public class PrintInfo {
     FileSystem hadoopFs = FileUtil.getFileSystem(conf, AccumuloConfiguration.getSiteConfiguration());
     FileSystem localFs = FileSystem.getLocal(conf);
     Path path = new Path(args[0]);
-    FileSystem fs = hadoopFs.exists(path) ? hadoopFs : localFs; // fall back to local
+    FileSystem fs;
+    if (args[0].contains(":"))
+      fs = path.getFileSystem(conf);
+    else
+      fs = hadoopFs.exists(path) ? hadoopFs : localFs; // fall back to local
     printMetaBlockInfo(conf, fs, path);
   }
 }


Mime
View raw message