Tabnine Logo
Host.setLocationInfo
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: com.datastax.cassandra/cassandra-driver-core

private static void updateLocationInfo(
  Host host,
  String datacenter,
  String rack,
  boolean isInitialConnection,
  Cluster.Manager cluster) {
 if (MoreObjects.equal(host.getDatacenter(), datacenter)
   && MoreObjects.equal(host.getRack(), rack)) return;
 // If the dc/rack information changes for an existing node, we need to update the load balancing
 // policy.
 // For that, we remove and re-add the node against the policy. Not the most elegant, and assumes
 // that the policy will update correctly, but in practice this should work.
 if (!isInitialConnection) cluster.loadBalancingPolicy().onDown(host);
 host.setLocationInfo(datacenter, rack);
 if (!isInitialConnection) cluster.loadBalancingPolicy().onAdd(host);
}
origin: com.stratio.cassandra/cassandra-driver-core

private static void updateLocationInfo(Host host, String datacenter, String rack, Cluster.Manager cluster) {
  if (Objects.equal(host.getDatacenter(), datacenter) && Objects.equal(host.getRack(), rack))
    return;
  // If the dc/rack information changes, we need to update the load balancing policy.
  // For that, we remove and re-add the node against the policy. Not the most elegant, and assumes
  // that the policy will update correctly, but in practice this should work.
  cluster.loadBalancingPolicy().onDown(host);
  host.setLocationInfo(datacenter, rack);
  cluster.loadBalancingPolicy().onAdd(host);
}
origin: com.facebook.presto.cassandra/cassandra-driver

private static void updateLocationInfo(Host host, String datacenter, String rack, boolean isInitialConnection, Cluster.Manager cluster) {
  if (Objects.equal(host.getDatacenter(), datacenter) && Objects.equal(host.getRack(), rack))
    return;
  // If the dc/rack information changes for an existing node, we need to update the load balancing policy.
  // For that, we remove and re-add the node against the policy. Not the most elegant, and assumes
  // that the policy will update correctly, but in practice this should work.
  if (!isInitialConnection)
    cluster.loadBalancingPolicy().onDown(host);
  host.setLocationInfo(datacenter, rack);
  if (!isInitialConnection)
    cluster.loadBalancingPolicy().onAdd(host);
}
origin: io.prestosql.cassandra/cassandra-driver

private static void updateLocationInfo(Host host, String datacenter, String rack, boolean isInitialConnection, Cluster.Manager cluster) {
  if (Objects.equal(host.getDatacenter(), datacenter) && Objects.equal(host.getRack(), rack))
    return;
  // If the dc/rack information changes for an existing node, we need to update the load balancing policy.
  // For that, we remove and re-add the node against the policy. Not the most elegant, and assumes
  // that the policy will update correctly, but in practice this should work.
  if (!isInitialConnection)
    cluster.loadBalancingPolicy().onDown(host);
  host.setLocationInfo(datacenter, rack);
  if (!isInitialConnection)
    cluster.loadBalancingPolicy().onAdd(host);
}
origin: com.yugabyte/cassandra-driver-core

private static void updateLocationInfo(Host host, String datacenter, String rack, boolean isInitialConnection, Cluster.Manager cluster) {
  if (MoreObjects.equal(host.getDatacenter(), datacenter) && MoreObjects.equal(host.getRack(), rack))
    return;
  // If the dc/rack information changes for an existing node, we need to update the load balancing policy.
  // For that, we remove and re-add the node against the policy. Not the most elegant, and assumes
  // that the policy will update correctly, but in practice this should work.
  if (!isInitialConnection)
    cluster.loadBalancingPolicy().onDown(host);
  host.setLocationInfo(datacenter, rack);
  if (!isInitialConnection)
    cluster.loadBalancingPolicy().onAdd(host);
}
com.datastax.driver.coreHostsetLocationInfo

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
  • setUp
  • setDown,
  • setUp,
  • wasJustAdded,
  • setDseGraphEnabled,
  • setDseVersion,
  • setDseWorkload,
  • setTokens,
  • setVersion,
  • getBroadcastSocketAddress

Popular in Java

  • Reading from database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • getSharedPreferences (Context)
  • onCreateOptionsMenu (Activity)
  • Kernel (java.awt.image)
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • BoxLayout (javax.swing)
  • JList (javax.swing)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now