List of usage examples for org.apache.hadoop.hdfs HAUtil getAddressOfActive
public static InetSocketAddress getAddressOfActive(FileSystem fs) throws IOException
From source file:com.cloudera.impala.service.JniFrontend.java
License:Apache License
/** * Derive the namenode http address from the current file system, * either default or as set by "-fs" in the generic options. * * @return Returns http address or null if failure. *///from w w w .jav a 2 s. c om private String getCurrentNameNodeAddress() throws Exception { // get the filesystem object to verify it is an HDFS system FileSystem fs; fs = FileSystem.get(CONF); if (!(fs instanceof DistributedFileSystem)) { LOG.error("FileSystem is " + fs.getUri()); return null; } return DFSUtil.getInfoServer(HAUtil.getAddressOfActive(fs), CONF, false); }