hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-14280 Bulk Upload from HA cluster to remote HA hbase cluster fails (Ankit Singhal)
Date Tue, 22 Sep 2015 16:23:20 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.1 489dd6427 -> ccb85d68f


HBASE-14280 Bulk Upload from HA cluster to remote HA hbase cluster fails (Ankit Singhal)


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

Branch: refs/heads/branch-1.1
Commit: ccb85d68f19c5ed177c8572b17da08f73ec70d82
Parents: 489dd64
Author: tedyu <yuzhihong@gmail.com>
Authored: Tue Sep 22 09:23:13 2015 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Tue Sep 22 09:23:13 2015 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/util/FSHDFSUtils.java   | 25 ++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/ccb85d68/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSHDFSUtils.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSHDFSUtils.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSHDFSUtils.java
index 0fffcc6..2e0795e 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSHDFSUtils.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSHDFSUtils.java
@@ -27,6 +27,7 @@ import java.net.URI;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
+import java.util.Collection;
 
 import com.google.common.collect.Sets;
 import org.apache.commons.logging.Log;
@@ -66,8 +67,17 @@ public class FSHDFSUtils extends FSUtils {
           dfsUtilClazz = Class.forName("org.apache.hadoop.hdfs.DFSUtil");
         }
         if (getNNAddressesMethod == null) {
-          getNNAddressesMethod =
-                  dfsUtilClazz.getMethod("getNNServiceRpcAddresses", Configuration.class);
+          try {
+            // getNNServiceRpcAddressesForCluster is available only in version
+            // equal to or later than Hadoop 2.6
+            getNNAddressesMethod =
+                dfsUtilClazz.getMethod("getNNServiceRpcAddressesForCluster", Configuration.class);
+          } catch (NoSuchMethodException e) {
+            // If hadoop version is older than hadoop 2.6
+            getNNAddressesMethod =
+                dfsUtilClazz.getMethod("getNNServiceRpcAddresses", Configuration.class);
+          }
+
         }
 
         Map<String, Map<String, InetSocketAddress>> addressMap =
@@ -115,6 +125,17 @@ public class FSHDFSUtils extends FSUtils {
     if (srcServiceName.equals(desServiceName)) {
       return true;
     }
+    if (srcServiceName.startsWith("ha-hdfs") && desServiceName.startsWith("ha-hdfs"))
{
+      Collection<String> internalNameServices =
+          conf.getTrimmedStringCollection("dfs.internal.nameservices");
+      if (!internalNameServices.isEmpty()) {
+        if (internalNameServices.contains(srcServiceName.split(":")[1])) {
+          return true;
+        } else {
+          return false;
+        }
+      }
+    }
     if (srcFs instanceof DistributedFileSystem && desFs instanceof DistributedFileSystem)
{
       //If one serviceName is an HA format while the other is a non-HA format,
       // maybe they refer to the same FileSystem.


Mime
View raw message