public HostAssert hasBroadcastAddress(InetAddress address) { assertThat(actual.getBroadcastAddress()).isNotNull().isEqualTo(address); return this; }
public HostAssert hasNoBroadcastAddress() { assertThat(actual.getBroadcastAddress()).isNull(); return this; }
public HostAssert hasBroadcastAddress(InetAddress address) { assertThat(actual.getBroadcastAddress()).isNotNull().isEqualTo(address); return this; }
public HostAssert hasNoBroadcastAddress() { assertThat(actual.getBroadcastAddress()).isNull(); return this; }
private Row fetchNodeInfo(Host host, Connection c) throws ConnectionException, BusyConnectionException, ExecutionException, InterruptedException { boolean isConnectedHost = c.address.equals(host.getSocketAddress()); if (isConnectedHost || host.getBroadcastAddress() != null) { DefaultResultSetFuture future = isConnectedHost ? new DefaultResultSetFuture(null, cluster.protocolVersion(), new Requests.Query(SELECT_LOCAL)) : new DefaultResultSetFuture(null, cluster.protocolVersion(), new Requests.Query(SELECT_PEERS + " WHERE peer='" + host.getBroadcastAddress().getHostAddress() + '\'')); c.write(future); Row row = future.get().one(); if (row != null) { return row; } else { logger.debug("Could not find peer with broadcast address {}, " + "falling back to a full system.peers scan to fetch info for {} " + "(this can happen if the broadcast address changed)", host.getBroadcastAddress(), host); } } // We have to fetch the whole peers table and find the host we're looking for DefaultResultSetFuture future = new DefaultResultSetFuture(null, cluster.protocolVersion(), new Requests.Query(SELECT_PEERS)); c.write(future); for (Row row : future.get()) { InetSocketAddress addr = rpcAddressForPeerHost(row, c.address, cluster); if (addr != null && addr.equals(host.getSocketAddress())) return row; } return null; }
private Row fetchNodeInfo(Host host, Connection c) throws ConnectionException, BusyConnectionException, ExecutionException, InterruptedException { boolean isConnectedHost = c.address.equals(host.getSocketAddress()); if (isConnectedHost || host.getBroadcastAddress() != null) { DefaultResultSetFuture future = isConnectedHost ? new DefaultResultSetFuture(null, cluster.protocolVersion(), new Requests.Query(SELECT_LOCAL)) : new DefaultResultSetFuture(null, cluster.protocolVersion(), new Requests.Query(SELECT_PEERS + " WHERE peer='" + host.getBroadcastAddress().getHostAddress() + '\'')); c.write(future); Row row = future.get().one(); if (row != null) { return row; } else { logger.debug("Could not find peer with broadcast address {}, " + "falling back to a full system.peers scan to fetch info for {} " + "(this can happen if the broadcast address changed)", host.getBroadcastAddress(), host); } } // We have to fetch the whole peers table and find the host we're looking for DefaultResultSetFuture future = new DefaultResultSetFuture(null, cluster.protocolVersion(), new Requests.Query(SELECT_PEERS)); c.write(future); for (Row row : future.get()) { InetSocketAddress addr = rpcAddressForPeerHost(row, c.address, cluster); if (addr != null && addr.equals(host.getSocketAddress())) return row; } return null; }
private Row fetchNodeInfo(Host host, Connection c) throws ConnectionException, BusyConnectionException, ExecutionException, InterruptedException { boolean isConnectedHost = c.address.equals(host.getSocketAddress()); if (isConnectedHost || host.getBroadcastAddress() != null) { DefaultResultSetFuture future = isConnectedHost ? new DefaultResultSetFuture(null, cluster.protocolVersion(), new Requests.Query(SELECT_LOCAL)) : new DefaultResultSetFuture(null, cluster.protocolVersion(), new Requests.Query(SELECT_PEERS + " WHERE peer='" + host.getBroadcastAddress().getHostAddress() + '\'')); c.write(future); Row row = future.get().one(); if (row != null) { return row; } else { logger.debug("Could not find peer with broadcast address {}, " + "falling back to a full system.peers scan to fetch info for {} " + "(this can happen if the broadcast address changed)", host.getBroadcastAddress(), host); } } // We have to fetch the whole peers table and find the host we're looking for DefaultResultSetFuture future = new DefaultResultSetFuture(null, cluster.protocolVersion(), new Requests.Query(SELECT_PEERS)); c.write(future); for (Row row : future.get()) { InetSocketAddress addr = rpcAddressForPeerHost(row, c.address, cluster); if (addr != null && addr.equals(host.getSocketAddress())) return row; } return null; }