本文整理了Java中org.apache.hadoop.hbase.net.Address.toStringWithoutDomain()
方法的一些代码示例,展示了Address.toStringWithoutDomain()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Address.toStringWithoutDomain()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.net.Address
类名称:Address
方法名:toStringWithoutDomain
[英]If hostname is a.b.c and the port is 123, return a:123 instead of a.b.c:123.
[中]如果主机名是a.b.c,端口是123,则返回a:123而不是a.b.c:123。
代码示例来源:origin: apache/hbase
Address.fromParts(initialIsa.getHostName(), initialIsa.getPort()).toStringWithoutDomain();
代码示例来源:origin: apache/hbase
@Test
public void testGetHostWithoutDomain() {
assertEquals("a:123",
Address.fromParts("a.b.c", 123).toStringWithoutDomain());
assertEquals("1:123",
Address.fromParts("1.b.c", 123).toStringWithoutDomain());
assertEquals("123.456.789.1:123",
Address.fromParts("123.456.789.1", 123).toStringWithoutDomain());
assertEquals("[2001:db8::1]:80",
Address.fromParts("[2001:db8::1]:", 80).toStringWithoutDomain());
assertEquals("[2001:db8::1]:80",
Address.fromParts("[2001:db8::1]:", 80).toStringWithoutDomain());
}
}
代码示例来源:origin: org.apache.hbase/hbase-common
@Test
public void testGetHostWithoutDomain() {
assertEquals("a:123",
Address.fromParts("a.b.c", 123).toStringWithoutDomain());
assertEquals("1:123",
Address.fromParts("1.b.c", 123).toStringWithoutDomain());
assertEquals("123.456.789.1:123",
Address.fromParts("123.456.789.1", 123).toStringWithoutDomain());
assertEquals("[2001:db8::1]:80",
Address.fromParts("[2001:db8::1]:", 80).toStringWithoutDomain());
assertEquals("[2001:db8::1]:80",
Address.fromParts("[2001:db8::1]:", 80).toStringWithoutDomain());
}
}
代码示例来源:origin: com.aliyun.hbase/alihbase-common
@Test
public void testGetHostWithoutDomain() {
assertEquals("a:123",
Address.fromParts("a.b.c", 123).toStringWithoutDomain());
assertEquals("1:123",
Address.fromParts("1.b.c", 123).toStringWithoutDomain());
assertEquals("123.456.789.1:123",
Address.fromParts("123.456.789.1", 123).toStringWithoutDomain());
assertEquals("[2001:db8::1]:80",
Address.fromParts("[2001:db8::1]:", 80).toStringWithoutDomain());
assertEquals("[2001:db8::1]:80",
Address.fromParts("[2001:db8::1]:", 80).toStringWithoutDomain());
}
}
内容来源于网络,如有侵权,请联系作者删除!