private int getDatanodeHttpPort(Configuration conf) {
    String address = conf.get("dfs.datanode.http.address", "");
    if (address.equals("")) {
      return -1;
    }
    return Integer.parseInt(address.split(":")[1]);
  }
private int getDatanodeHttpPort ( Configuration conf ) { String address = conf . get ( "dfs.datanode.http.address" , "" ) ; if ( address . equals ( "" ) ) { return - 1 ; } return Integer . parseInt ( address . split ( ":" ) [ 1 ] ) ; }
Get datanode http port from configration