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

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

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

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

<E extends Throwable> E defunct(E e) {
 if (isDefunct.compareAndSet(false, true)) {
  if (Host.statesLogger.isTraceEnabled()) Host.statesLogger.trace("Defuncting " + this, e);
  else if (Host.statesLogger.isDebugEnabled())
   Host.statesLogger.debug("Defuncting {} because: {}", this, e.getMessage());
  Host host = factory.manager.metadata.getHost(address);
  if (host != null) {
   // Sometimes close() can be called before defunct(); avoid decrementing the connection count
   // twice, but
   // we still want to signal the error to the conviction policy.
   boolean decrement = signaled.compareAndSet(false, true);
   boolean hostDown = host.convictionPolicy.signalConnectionFailure(this, decrement);
   if (hostDown) {
    factory.manager.signalHostDown(host, host.wasJustAdded());
   } else {
    notifyOwnerWhenDefunct();
   }
  }
  // Force the connection to close to make sure the future completes. Otherwise force() might
  // never get called and
  // threads will wait on the future forever.
  // (this also errors out pending handlers)
  closeAsync().force();
 }
 return e;
}
origin: com.facebook.presto.cassandra/cassandra-driver

<E extends Exception> E defunct(E e) {
  if (isDefunct.compareAndSet(false, true)) {
    if (Host.statesLogger.isTraceEnabled())
      Host.statesLogger.trace("Defuncting " + this, e);
    else if (Host.statesLogger.isDebugEnabled())
      Host.statesLogger.debug("Defuncting {} because: {}", this, e.getMessage());
    Host host = factory.manager.metadata.getHost(address);
    if (host != null) {
      // Sometimes close() can be called before defunct(); avoid decrementing the connection count twice, but
      // we still want to signal the error to the conviction policy.
      boolean decrement = signaled.compareAndSet(false, true);
      boolean hostDown = host.convictionPolicy.signalConnectionFailure(this, decrement);
      if (hostDown) {
        factory.manager.signalHostDown(host, host.wasJustAdded());
      } else {
        notifyOwnerWhenDefunct();
      }
    }
    // Force the connection to close to make sure the future completes. Otherwise force() might never get called and
    // threads will wait on the future forever.
    // (this also errors out pending handlers)
    closeAsync().force();
  }
  return e;
}
origin: io.prestosql.cassandra/cassandra-driver

<E extends Exception> E defunct(E e) {
  if (isDefunct.compareAndSet(false, true)) {
    if (Host.statesLogger.isTraceEnabled())
      Host.statesLogger.trace("Defuncting " + this, e);
    else if (Host.statesLogger.isDebugEnabled())
      Host.statesLogger.debug("Defuncting {} because: {}", this, e.getMessage());
    Host host = factory.manager.metadata.getHost(address);
    if (host != null) {
      // Sometimes close() can be called before defunct(); avoid decrementing the connection count twice, but
      // we still want to signal the error to the conviction policy.
      boolean decrement = signaled.compareAndSet(false, true);
      boolean hostDown = host.convictionPolicy.signalConnectionFailure(this, decrement);
      if (hostDown) {
        factory.manager.signalHostDown(host, host.wasJustAdded());
      } else {
        notifyOwnerWhenDefunct();
      }
    }
    // Force the connection to close to make sure the future completes. Otherwise force() might never get called and
    // threads will wait on the future forever.
    // (this also errors out pending handlers)
    closeAsync().force();
  }
  return e;
}
origin: com.yugabyte/cassandra-driver-core

<E extends Exception> E defunct(E e) {
  if (isDefunct.compareAndSet(false, true)) {
    if (Host.statesLogger.isTraceEnabled())
      Host.statesLogger.trace("Defuncting " + this, e);
    else if (Host.statesLogger.isDebugEnabled())
      Host.statesLogger.debug("Defuncting {} because: {}", this, e.getMessage());
    Host host = factory.manager.metadata.getHost(address);
    if (host != null) {
      // Sometimes close() can be called before defunct(); avoid decrementing the connection count twice, but
      // we still want to signal the error to the conviction policy.
      boolean decrement = signaled.compareAndSet(false, true);
      boolean hostDown = host.convictionPolicy.signalConnectionFailure(this, decrement);
      if (hostDown) {
        factory.manager.signalHostDown(host, host.wasJustAdded());
      } else {
        notifyOwnerWhenDefunct();
      }
    }
    // Force the connection to close to make sure the future completes. Otherwise force() might never get called and
    // threads will wait on the future forever.
    // (this also errors out pending handlers)
    closeAsync().force();
  }
  return e;
}
origin: com.stratio.cassandra/cassandra-driver-core

ConnectionException defunct(ConnectionException e) {
  if (logger.isDebugEnabled())
    logger.debug("Defuncting connection to " + address, e);
  exception = e;
  isDefunct = true;
  dispatcher.errorOutAllHandler(e);
  Host host = factory.manager.metadata.getHost(address);
  if (host != null) {
    boolean isDown = factory.manager.signalConnectionFailure(host, e, host.wasJustAdded());
    notifyOwnerWhenDefunct(isDown);
  }
  closeAsync();
  return e;
}
com.datastax.driver.coreHostwasJustAdded

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

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getResourceAsStream (ClassLoader)
  • setScale (BigDecimal)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Top Sublime Text plugins
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