Java Code Examples for org.apache.hadoop.conf.Configuration.setSocketAddr()

The following are Jave code examples for showing how to use setSocketAddr() of the org.apache.hadoop.conf.Configuration class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: hadoop-oss   File: TestNetUtils.java   Source Code and License Vote up 5 votes
@Test
public void testTrimCreateSocketAddress() {
  Configuration conf = new Configuration();
  NetUtils.addStaticResolution("host", "127.0.0.1");
  final String defaultAddr = "host:1  ";

  InetSocketAddress addr = NetUtils.createSocketAddr(defaultAddr);
  conf.setSocketAddr("myAddress", addr);
  assertEquals(defaultAddr.trim(), NetUtils.getHostPortString(addr));
}
 
Example 2
Project: hadoop   File: TestNetUtils.java   Source Code and License Vote up 5 votes
@Test
public void testTrimCreateSocketAddress() {
  Configuration conf = new Configuration();
  NetUtils.addStaticResolution("host", "127.0.0.1");
  final String defaultAddr = "host:1  ";

  InetSocketAddress addr = NetUtils.createSocketAddr(defaultAddr);
  conf.setSocketAddr("myAddress", addr);
  assertEquals(defaultAddr.trim(), NetUtils.getHostPortString(addr));
}