accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject [4/4] git commit: ACCUMULO-2044 fix HdfsZooInstance issue w/ multiple namenodes
Date Fri, 20 Dec 2013 04:10:05 GMT
ACCUMULO-2044 fix HdfsZooInstance issue w/ multiple namenodes


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

Branch: refs/heads/1.6.0-SNAPSHOT
Commit: cddf04f72cf7490c5e7a096d742ef877d485798f
Parents: 0893667
Author: Keith Turner <kturner@apache.org>
Authored: Wed Dec 18 00:10:56 2013 -0500
Committer: Keith Turner <kturner@apache.org>
Committed: Thu Dec 19 23:00:02 2013 -0500

----------------------------------------------------------------------
 .../accumulo/core/client/admin/TableOperationsImpl.java      | 4 +---
 .../org/apache/accumulo/core/client/impl/OfflineScanner.java | 8 +-------
 .../main/java/org/apache/accumulo/core/file/FileUtil.java    | 7 +++++++
 .../java/org/apache/accumulo/core/zookeeper/ZooUtil.java     | 4 +++-
 4 files changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/cddf04f7/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
b/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
index 26192ef..76cda7d 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
@@ -1152,13 +1152,11 @@ public class TableOperationsImpl extends TableOperationsHelper {
   @SuppressWarnings("deprecation")
   private Path checkPath(String dir, String kind, String type) throws IOException, AccumuloException
{
     Path ret;
-    FileSystem fs;
+    FileSystem fs = FileUtil.getFileSystem(dir, CachedConfiguration.getInstance(), ServerConfigurationUtil.getConfiguration(instance));
 
     if (dir.contains(":")) {
       ret = new Path(dir);
-      fs = ret.getFileSystem(CachedConfiguration.getInstance());
     } else {
-      fs = FileUtil.getFileSystem(CachedConfiguration.getInstance(), ServerConfigurationUtil.getConfiguration(instance));
       ret = fs.makeQualified(new Path(dir));
     }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/cddf04f7/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 6e08710..0cb0409 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,7 +67,6 @@ 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>> {
@@ -296,8 +295,6 @@ class OfflineIterator implements Iterator<Entry<Key,Value>>
{
     
     Configuration conf = CachedConfiguration.getInstance();
     
-    FileSystem defaultFs = FileUtil.getFileSystem(conf, ServerConfigurationUtil.getConfiguration(instance));
-    
     for (SortedKeyValueIterator<Key,Value> reader : readers) {
       ((FileSKVIterator) reader).close();
     }
@@ -306,10 +303,7 @@ 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);
-
+      FileSystem fs = FileUtil.getFileSystem(file, conf, ServerConfigurationUtil.getConfiguration(instance));
       FileSKVIterator reader = FileOperations.getInstance().openReader(file, false, fs, conf,
acuTableConf, null, null);
       readers.add(reader);
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/cddf04f7/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java b/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java
index 998aa9e..33e1835 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java
@@ -544,6 +544,13 @@ public class FileUtil {
     return results;
   }
   
+  public static FileSystem getFileSystem(String path, Configuration conf, AccumuloConfiguration
acuconf) throws IOException {
+    if (path.contains(":"))
+      return new Path(path).getFileSystem(conf);
+    else
+      return getFileSystem(conf, acuconf);
+  }
+
   public static FileSystem getFileSystem(Configuration conf, AccumuloConfiguration acuconf)
throws IOException {
     String uri = acuconf.get(Property.INSTANCE_DFS_URI);
     if ("".equals(uri))

http://git-wip-us.apache.org/repos/asf/accumulo/blob/cddf04f7/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooUtil.java b/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooUtil.java
index 17447e5..9206beb 100644
--- a/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooUtil.java
+++ b/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooUtil.java
@@ -44,10 +44,12 @@ public class ZooUtil extends org.apache.accumulo.fate.zookeeper.ZooUtil
{
   /**
    * Utility to support certain client side utilities to minimize command-line options.
    */
+
   public static String getInstanceIDFromHdfs(Path instanceDirectory) {
     try {
+
       @SuppressWarnings("deprecation")
-      FileSystem fs = FileUtil.getFileSystem(CachedConfiguration.getInstance(), AccumuloConfiguration.getSiteConfiguration());
+      FileSystem fs = FileUtil.getFileSystem(instanceDirectory.toString(), CachedConfiguration.getInstance(),
AccumuloConfiguration.getSiteConfiguration());
       FileStatus[] files = null;
       try {
         files = fs.listStatus(instanceDirectory);


Mime
View raw message