From ecd9914dc991df518d41b6748590cace7d768c4e Mon Sep 17 00:00:00 2001 From: Wei-Chiu Chuang Date: Tue, 10 Apr 2018 19:44:37 -0700 Subject: [PATCH] HBASE-19963 TestFSHDFSUtils assumes wrong default port for Hadoop 3.0.1+ Signed-off-by: Mike Drob --- .../org/apache/hadoop/hbase/util/TestFSHDFSUtils.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSHDFSUtils.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSHDFSUtils.java index d500cf9ec18..e88dd5ff29a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSHDFSUtils.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSHDFSUtils.java @@ -152,12 +152,14 @@ public class TestFSHDFSUtils { public void testIsSameHdfs() throws IOException { String hadoopVersion = org.apache.hadoop.util.VersionInfo.getVersion(); LOG.info("hadoop version is: " + hadoopVersion); - boolean isHadoop3 = hadoopVersion.startsWith("3."); - if (isHadoop3) { - // Hadoop 3.0.0 alpha1+ change default nn port to 9820. See HDFS-9427 + boolean isHadoop3_0_0 = hadoopVersion.startsWith("3.0.0"); + if (isHadoop3_0_0) { + // Hadoop 3.0.0 alpha1+ ~ 3.0.0 GA changed default nn port to 9820. + // See HDFS-9427 testIsSameHdfs(9820); } else { // pre hadoop 3.0.0 defaults to port 8020 + // Hadoop 3.0.1 changed it back to port 8020. See HDFS-12990 testIsSameHdfs(8020); } }