AbstractWriteResponseHandler (apache-cassandra API)
Date: 2014-10-21

org.apache.cassandra.service

## Class AbstractWriteResponseHandler

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

- All Implemented Interfaces:
    IAsyncCallback
  Direct Known Subclasses:
    DatacenterSyncWriteResponseHandler, WriteResponseHandler

      public abstract class AbstractWriteResponseHandler
      extends java.lang.Object
      implements IAsyncCallback

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.Runnable` | `callback`
    `ConsistencyLevel` | `consistencyLevel`
    `protected Keyspace` | `keyspace`
    `protected java.util.Collection<java.net.InetAddress>` | `naturalEndpoints`
    `protected java.util.Collection<java.net.InetAddress>` | `pendingEndpoints`
    `protected long` | `start`

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

      `isAlive`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractWriteResponseHandler(Keyspace keyspace, java.util.Collection<java.net.InetAddress> naturalEndpoints, java.util.Collection<java.net.InetAddress> pendingEndpoints, ConsistencyLevel consistencyLevel, java.lang.Runnable callback, WriteType writeType)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract int` | `ackCount()`
    `void` | `assureSufficientLiveNodes()`
    `void` | `get()`
    `abstract void` | `response(MessageIn msg)` null message means "response from local write"
    `protected void` | `signal()`
    `protected int` | `totalBlockFor()`

    - ### 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.IAsyncCallback

      `isLatencyForSnitch`

- - ### Field Detail

    - #### keyspace

          protected final Keyspace keyspace

    - #### start

          protected final long start

    - #### naturalEndpoints

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

    - #### consistencyLevel

          public final ConsistencyLevel consistencyLevel

    - #### callback

          protected final java.lang.Runnable callback

    - #### pendingEndpoints

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

  - ### Constructor Detail

    - #### AbstractWriteResponseHandler

          protected AbstractWriteResponseHandler(Keyspace keyspace,
                                      java.util.Collection<java.net.InetAddress> naturalEndpoints,
                                      java.util.Collection<java.net.InetAddress> pendingEndpoints,
                                      ConsistencyLevel consistencyLevel,
                                      java.lang.Runnable callback,
                                      WriteType writeType)

      Parameters:
        `callback` - A callback to be called when the write is successful.

  - ### Method Detail

    - #### get

          public void get()
                   throws WriteTimeoutException

      Throws:
        `WriteTimeoutException`

    - #### totalBlockFor

          protected int totalBlockFor()

    - #### ackCount

          protected abstract int ackCount()

    - #### response

          public abstract void response(MessageIn msg)

      null message means "response from local write"
      Specified by:
        `response` in interface `IAsyncCallback`
      Parameters:
        `msg` - response received.

    - #### assureSufficientLiveNodes

          public void assureSufficientLiveNodes()
                                         throws UnavailableException

      Throws:
        `UnavailableException`

    - #### signal

          protected void signal()

Copyright © 2014 The Apache Software Foundation