HBASE-10717 TestFSHDFSUtils#testIsSameHdfs fails with IllegalArgumentException running against hadoop 2.3

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1576371 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2014-03-11 14:53:39 +00:00
parent 85fd591a19
commit fdd4e8a01b
1 changed files with 6 additions and 1 deletions

View File

@ -85,7 +85,12 @@ public class FSHDFSUtils extends FSUtils {
}
} else {
URI uri = fs.getUri();
InetSocketAddress addr = new InetSocketAddress(uri.getHost(), uri.getPort());
int port = uri.getPort();
if (port < 0) {
int idx = serviceName.indexOf(':');
port = Integer.parseInt(serviceName.substring(idx+1));
}
InetSocketAddress addr = new InetSocketAddress(uri.getHost(), port);
addresses.add(addr);
}