DatacenterWriteResponseHandler (apache-cassandra API)
Date: 2018-02-14

org.apache.cassandra.service

## Class DatacenterWriteResponseHandler<T>

- java.lang.Object
- - org.apache.cassandra.service.AbstractWriteResponseHandler<T>
  - - org.apache.cassandra.service.WriteResponseHandler<T>
    - - org.apache.cassandra.service.DatacenterWriteResponseHandler<T>

- All Implemented Interfaces:
    IAsyncCallback<T>, IAsyncCallbackWithFailure<T>

      public class DatacenterWriteResponseHandler<T>
      extends WriteResponseHandler<T>

  This class blocks for a quorum of responses _in the local datacenter only_ (CL.LOCAL_QUORUM).

- - ### Field Summary

    - ### Fields inherited from class org.apache.cassandra.service.WriteResponseHandler

      `logger, responses`

    - ### Fields inherited from class org.apache.cassandra.service.AbstractWriteResponseHandler

      `callback, consistencyLevel, keyspace, naturalEndpoints, pendingEndpoints, writeType`

    - ### Fields inherited from interface org.apache.cassandra.net.IAsyncCallback

      `isAlive`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DatacenterWriteResponseHandler(java.util.Collection<java.net.InetAddress> naturalEndpoints, java.util.Collection<java.net.InetAddress> pendingEndpoints, ConsistencyLevel consistencyLevel, Keyspace keyspace, java.lang.Runnable callback, WriteType writeType, long queryStartNanoTime)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `response(MessageIn<T> message)` null message means "response from local write"
    `protected int` | `totalBlockFor()`
    `protected boolean` | `waitingFor(java.net.InetAddress from)`

    - ### Methods inherited from class org.apache.cassandra.service.WriteResponseHandler

      `ackCount, isLatencyForSnitch`

    - ### Methods inherited from class org.apache.cassandra.service.AbstractWriteResponseHandler

      `assureSufficientLiveNodes, currentTimeout, get, onFailure, setSupportsBackPressure, signal, supportsBackPressure, totalEndpoints`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DatacenterWriteResponseHandler

          public DatacenterWriteResponseHandler(java.util.Collection<java.net.InetAddress> naturalEndpoints,
                                                java.util.Collection<java.net.InetAddress> pendingEndpoints,
                                                ConsistencyLevel consistencyLevel,
                                                Keyspace keyspace,
                                                java.lang.Runnable callback,
                                                WriteType writeType,
                                                long queryStartNanoTime)

  - ### Method Detail

    - #### response

          public void response(MessageIn<T> message)

      Description copied from class: `AbstractWriteResponseHandler`
      null message means "response from local write"
      Specified by:
        `response` in interface `IAsyncCallback<T>`
      Overrides:
        `response` in class `WriteResponseHandler<T>`
      Parameters:
        `message` - response received.

    - #### totalBlockFor

          protected int totalBlockFor()

      Overrides:
        `totalBlockFor` in class `AbstractWriteResponseHandler<T>`
      Returns:
        the minimum number of endpoints that must reply.

    - #### waitingFor

          protected boolean waitingFor(java.net.InetAddress from)

      Overrides:
        `waitingFor` in class `AbstractWriteResponseHandler<T>`
      Returns:
        true if the message counts towards the totalBlockFor() threshold

Copyright © 2018 The Apache Software Foundation