## org.apache.cassandra.service
Class WriteResponseHandler

    java.lang.Object
      org.apache.cassandra.service.AbstractWriteResponseHandler
          org.apache.cassandra.service.WriteResponseHandler

All Implemented Interfaces:
  IAsyncCallback, IMessageCallback, IWriteResponseHandler

Direct Known Subclasses:
  DatacenterWriteResponseHandler

    public class WriteResponseHandler

extends AbstractWriteResponseHandler

Handles blocking writes for ONE, ANY, TWO, THREE, QUORUM, and ALL consistency levels.

Field Summary
`protected static org.slf4j.Logger` `logger`
`protected java.util.concurrent.atomic.AtomicInteger` `responses`

Fields inherited from class org.apache.cassandra.service.AbstractWriteResponseHandler
`condition, consistencyLevel, startTime, writeEndpoints`

Constructor Summary
`protected` `WriteResponseHandler(java.util.Collection<java.net.InetAddress> writeEndpoints, ConsistencyLevel consistencyLevel, java.lang.String table)`
`protected` `WriteResponseHandler(java.net.InetAddress endpoint)`

Method Summary
`void` `assureSufficientLiveNodes()`
`static IWriteResponseHandler` `create(java.util.Collection<java.net.InetAddress> writeEndpoints, ConsistencyLevel consistencyLevel, java.lang.String table)`
`static IWriteResponseHandler` `create(java.net.InetAddress endpoint)`
`protected int` `determineBlockFor(java.lang.String table)`
`boolean` `isLatencyForSnitch()`
`void` `response(Message m)` null message means "response from local write"

Methods inherited from class org.apache.cassandra.service.AbstractWriteResponseHandler
`get`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### logger

    protected static final org.slf4j.Logger logger

### responses

    protected final java.util.concurrent.atomic.AtomicInteger responses

Constructor Detail

### WriteResponseHandler

    protected WriteResponseHandler(java.util.Collection<java.net.InetAddress> writeEndpoints,
                                   ConsistencyLevel consistencyLevel,
                                   java.lang.String table)

### WriteResponseHandler

    protected WriteResponseHandler(java.net.InetAddress endpoint)

Method Detail

### create

    public static IWriteResponseHandler create(java.util.Collection<java.net.InetAddress> writeEndpoints,
                                               ConsistencyLevel consistencyLevel,
                                               java.lang.String table)

### create

    public static IWriteResponseHandler create(java.net.InetAddress endpoint)

### response

    public void response(Message m)

  Description copied from class: `AbstractWriteResponseHandler`
  null message means "response from local write"

  Specified by:
    `response` in interface `IAsyncCallback`
  Specified by:
    `response` in class `AbstractWriteResponseHandler`
  Parameters:
    `m` - response received.

### determineBlockFor

    protected int determineBlockFor(java.lang.String table)

### assureSufficientLiveNodes

    public void assureSufficientLiveNodes()
                                   throws UnavailableException

  Specified by:
    `assureSufficientLiveNodes` in interface `IWriteResponseHandler`
  Specified by:
    `assureSufficientLiveNodes` in class `AbstractWriteResponseHandler`
  Throws:
    `UnavailableException`

### isLatencyForSnitch

    public boolean isLatencyForSnitch()

  Returns:
    true if this callback is on the read path and its latency should be given as input to the dynamic snitch.

Copyright © 2012 The Apache Software Foundation