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

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

Best Java code snippets using com.datastax.driver.core.Host.getTokens (Showing top 4 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

/** @return A mapping of Host -> Token for each Host in the given {@link Metadata} */
private Map<Host, Token> getTokenForHosts(Metadata metadata) {
 Map<Host, Token> tokensByHost = Maps.newHashMap();
 for (Host host : metadata.getAllHosts()) {
  tokensByHost.put(host, host.getTokens().iterator().next());
 }
 return tokensByHost;
}
origin: com.datastax.cassandra/cassandra-driver-core

public void should_expose_tokens_per_host() {
 for (Host host : cluster().getMetadata().allHosts()) {
  assertThat(host.getTokens()).hasSize(numTokens);
  assertThat(host.getTokens())
    .containsOnlyOnce(Iterables.toArray(tokensFromSystemTable, Token.class));
origin: com.datastax.dse/dse-java-driver-core

/** @return A mapping of Host -> Token for each Host in the given {@link Metadata} */
private Map<Host, Token> getTokenForHosts(Metadata metadata) {
 Map<Host, Token> tokensByHost = Maps.newHashMap();
 for (Host host : metadata.getAllHosts()) {
  tokensByHost.put(host, host.getTokens().iterator().next());
 }
 return tokensByHost;
}
origin: com.datastax.dse/dse-java-driver-core

public void should_expose_tokens_per_host() {
 for (Host host : cluster().getMetadata().allHosts()) {
  assertThat(host.getTokens()).hasSize(numTokens);
  assertThat(host.getTokens())
    .containsOnlyOnce(Iterables.toArray(tokensFromSystemTable, Token.class));
com.datastax.driver.coreHostgetTokens

Javadoc

Returns the tokens that this host owns.

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,
  • getBroadcastSocketAddress

Popular in Java

  • Updating database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • putExtra (Intent)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • String (java.lang)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
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