Skip to content

Instantly share code, notes, and snippets.

@jiminoc
Created June 24, 2011 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jiminoc/1045541 to your computer and use it in GitHub Desktop.
Save jiminoc/1045541 to your computer and use it in GitHub Desktop.
public void testThatDifferentRPCandHttpPortsAreOK()
throws IOException {
Configuration conf = new HdfsConfiguration();
FileSystem.setDefaultUri(conf, "hdfs://localhost:8000");
conf.set(DFSConfigKeys.DFS_NAMENODE_HTTP_ADDRESS_KEY, "127.0.0.1:9000");
try {
NameNode nameNode = new NameNode(conf); // should be OK!
} catch (Exception e) {
System.out.println("Got expected exception: " + e.toString());
Assert.fail("Should have throw the exception since the ports match");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment