Codota Logo
Host.getBroadcastSocketAddress
Code IndexAdd Codota to your IDE (free)

How to use
getBroadcastSocketAddress
method
in
com.datastax.driver.core.Host

Best Java code snippets using com.datastax.driver.core.Host.getBroadcastSocketAddress (Showing top 9 results out of 315)

  • Common ways to obtain Host
private void myMethod () {
Host h =
  • Codota IconControlConnection controlConnection;controlConnection.connectedHost()
  • Codota IconMetadata metadata;InetSocketAddress address;metadata.getHost(address)
  • Codota IconConcurrentMap concurrentMap;Object object;concurrentMap.get(object)
  • Smart code suggestions by Codota
}
origin: com.datastax.cassandra/cassandra-driver-core

public HostAssert hasBroadcastSocketAddress(InetSocketAddress address) {
 assertThat(actual.getBroadcastSocketAddress()).isNotNull().isEqualTo(address);
 return this;
}
origin: com.datastax.cassandra/cassandra-driver-core

public HostAssert hasNoBroadcastSocketAddress() {
 assertThat(actual.getBroadcastSocketAddress()).isNull();
 return this;
}
origin: com.datastax.cassandra/cassandra-driver-core

   InterruptedException {
boolean isConnectedHost = c.address.equals(host.getSocketAddress());
if (isConnectedHost || host.getBroadcastSocketAddress() != null) {
 String query;
 if (isConnectedHost) {
  query = SELECT_LOCAL;
 } else {
  InetSocketAddress broadcastAddress = host.getBroadcastSocketAddress();
  query =
    isPeersV2
  return row;
 } else {
  InetSocketAddress address = host.getBroadcastSocketAddress();
origin: com.datastax.cassandra/cassandra-driver-core

assertThat(host.getBroadcastSocketAddress()).isNotNull();
row =
  session()
    .execute(
      "select tokens from system.peers where peer = '"
        + host.getBroadcastSocketAddress().getAddress().getHostAddress()
        + "'")
    .one();
origin: com.datastax.cassandra/cassandra-driver-core

assertThat(host2).isNotNull();
InetSocketAddress node2OldBroadcastAddress = host2.getBroadcastSocketAddress();
InetSocketAddress node2NewBroadcastAddress =
  new InetSocketAddress(InetAddress.getByName("1.2.3.4"), scassandras.getBinaryPort());
assertThat(host2.getBroadcastSocketAddress().getAddress())
  .isEqualTo(node2NewBroadcastAddress.getAddress());
origin: com.datastax.dse/dse-java-driver-core

public HostAssert hasBroadcastSocketAddress(InetSocketAddress address) {
 assertThat(actual.getBroadcastSocketAddress()).isNotNull().isEqualTo(address);
 return this;
}
origin: com.datastax.dse/dse-java-driver-core

public HostAssert hasNoBroadcastSocketAddress() {
 assertThat(actual.getBroadcastSocketAddress()).isNull();
 return this;
}
origin: com.datastax.dse/dse-java-driver-core

assertThat(host.getBroadcastSocketAddress()).isNotNull();
row =
  session()
    .execute(
      "select tokens from system.peers where peer = '"
        + host.getBroadcastSocketAddress().getAddress().getHostAddress()
        + "'")
    .one();
origin: com.datastax.dse/dse-java-driver-core

assertThat(host2).isNotNull();
InetSocketAddress node2OldBroadcastAddress = host2.getBroadcastSocketAddress();
InetSocketAddress node2NewBroadcastAddress =
  new InetSocketAddress(InetAddress.getByName("1.2.3.4"), scassandras.getBinaryPort());
assertThat(host2.getBroadcastSocketAddress().getAddress())
  .isEqualTo(node2NewBroadcastAddress.getAddress());
com.datastax.driver.coreHostgetBroadcastSocketAddress

Javadoc

Returns the node broadcast address (that is, the address by which it should be contacted by other peers in the cluster), if known. Otherwise null.

Note that the port of the returned address will be 0 for versions of Cassandra older than 4.0.

This corresponds to the broadcast_address cassandra.yaml file setting and is by default the same as #getListenSocketAddress(), unless specified otherwise in cassandra.yaml. This is NOT the address clients should use to contact this node.

This information is always available for peer hosts. For the control host, it's only available if CASSANDRA-9436 is fixed on the server side (Cassandra versions >= 2.0.16, 2.1.6, 2.2.0 rc1). For older versions, note that if the driver loses the control connection and reconnects to a different control host, the old control host becomes a peer, and therefore its broadcast address is updated.

Popular methods of Host

  • getAddress
    Returns the address that the driver will use to connect to the node. This is a shortcut for getSocke
  • getDatacenter
    Returns the name of the datacenter this host is part of. The returned datacenter name is the one as
  • getRack
    Returns the name of the rack this host is part of. The returned rack name is the one as known by Cas
  • getCassandraVersion
    The Cassandra version the host is running. It is also possible for this information to be unavailabl
  • isUp
    Returns whether the host is considered up by the driver. Please note that this is only the view of t
  • getSocketAddress
    Returns the address and port that the driver will use to connect to the node. This is the node's br
  • toString
  • equals
  • <init>
  • getBroadcastAddress
    Returns the node broadcast address (that is, the IP by which it should be contacted by other peers i
  • setDown
  • setLocationInfo
  • setDown,
  • setLocationInfo,
  • setUp,
  • wasJustAdded,
  • setDseGraphEnabled,
  • setDseVersion,
  • setDseWorkload,
  • setTokens,
  • setVersion

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onRequestPermissionsResult (Fragment)
  • startActivity (Activity)
  • Color (java.awt)
    The Color class is used encapsulate colors in the default sRGB color space or colors in arbitrary co
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now