## org.apache.cassandra.service
Class AbstractWriteResponseHandler

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

All Implemented Interfaces:
  IAsyncCallback, IMessageCallback, IWriteResponseHandler

Direct Known Subclasses:
  DatacenterSyncWriteResponseHandler, WriteResponseHandler

    public abstract class AbstractWriteResponseHandler

extends java.lang.Object
implements IWriteResponseHandler

Field Summary
`protected java.lang.Runnable` `callback`
`protected ConsistencyLevel` `consistencyLevel`
`protected long` `startTime`
`protected java.util.Collection<java.net.InetAddress>` `writeEndpoints`

Constructor Summary
`protected` `AbstractWriteResponseHandler(java.util.Collection<java.net.InetAddress> writeEndpoints, ConsistencyLevel consistencyLevel, java.lang.Runnable callback)`

Method Summary
`abstract void` `assureSufficientLiveNodes()`
`void` `get()`
`abstract void` `response(Message msg)` null message means "response from local write"
`protected void` `signal()`

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

Methods inherited from interface org.apache.cassandra.net.IMessageCallback
`isLatencyForSnitch`

Field Detail

### startTime

    protected final long startTime

### writeEndpoints

    protected final java.util.Collection<java.net.InetAddress> writeEndpoints

### consistencyLevel

    protected final ConsistencyLevel consistencyLevel

### callback

    protected final java.lang.Runnable callback

Constructor Detail

### AbstractWriteResponseHandler

    protected AbstractWriteResponseHandler(java.util.Collection<java.net.InetAddress> writeEndpoints,
                                           ConsistencyLevel consistencyLevel,
                                           java.lang.Runnable callback)

Parameters:
  `callback` - A callback to be called when the write is successful. Note that this callback will *not* be called in case of an exception (timeout or unavailable).

Method Detail

### get

    public void get()
             throws java.util.concurrent.TimeoutException

  Specified by:
    `get` in interface `IWriteResponseHandler`
  Throws:
    `java.util.concurrent.TimeoutException`

### response

    public abstract void response(Message msg)

  null message means "response from local write"

  Specified by:
    `response` in interface `IAsyncCallback`
  Parameters:
    `msg` - response received.

### assureSufficientLiveNodes

    public abstract void assureSufficientLiveNodes()
                                            throws UnavailableException

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

### signal

    protected void signal()

Copyright © 2013 The Apache Software Foundation