com.hazelcast.nio.Address.getScopedHost()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(107)

本文整理了Java中com.hazelcast.nio.Address.getScopedHost()方法的一些代码示例,展示了Address.getScopedHost()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Address.getScopedHost()方法的具体详情如下:
包路径:com.hazelcast.nio.Address
类名称:Address
方法名:getScopedHost

Address.getScopedHost介绍

暂无

代码示例

代码示例来源:origin: hazelcast/hazelcast-jet

  1. public InetAddress getInetAddress() throws UnknownHostException {
  2. return InetAddress.getByName(getScopedHost());
  3. }

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. public InetAddress getInetAddress() throws UnknownHostException {
  2. return InetAddress.getByName(getScopedHost());
  3. }

代码示例来源:origin: hazelcast/hazelcast-jet

  1. private boolean isSplitLocalForMember(InputSplit split, Address memberAddr) {
  2. try {
  3. final InetAddress inetAddr = memberAddr.getInetAddress();
  4. return Arrays.stream(split.getLocations())
  5. .flatMap(loc -> Arrays.stream(uncheckCall(() -> InetAddress.getAllByName(loc))))
  6. .anyMatch(inetAddr::equals);
  7. } catch (IOException e) {
  8. if (e instanceof UnknownHostException) {
  9. logger.warning("Failed to resolve host name for the split, " +
  10. "will use host name equality to determine data locality", e);
  11. return isSplitLocalForMember(split, memberAddr.getScopedHost());
  12. }
  13. throw sneakyThrow(e);
  14. }
  15. }

代码示例来源:origin: com.hazelcast.jet/hazelcast-jet-hadoop

  1. private boolean isSplitLocalForMember(InputSplit split, Address memberAddr) {
  2. try {
  3. final InetAddress inetAddr = memberAddr.getInetAddress();
  4. return Arrays.stream(split.getLocations())
  5. .flatMap(loc -> Arrays.stream(uncheckCall(() -> InetAddress.getAllByName(loc))))
  6. .anyMatch(inetAddr::equals);
  7. } catch (IOException e) {
  8. if (e instanceof UnknownHostException) {
  9. logger.warning("Failed to resolve host name for the split, " +
  10. "will use host name equality to determine data locality", e);
  11. return isSplitLocalForMember(split, memberAddr.getScopedHost());
  12. }
  13. throw sneakyThrow(e);
  14. }
  15. }

相关文章