org.apache.cassandra.service

## Class AbstractWriteResponseHandler

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

- All Implemented Interfaces:
    IAsyncCallback, IMessageCallback
  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`
    `protected ConsistencyLevel` | `consistencyLevel`
    `protected java.util.Collection<java.net.InetAddress>` | `naturalEndpoints`
    `protected java.util.Collection<java.net.InetAddress>` | `pendingEndpoints`
    `protected long` | `startTime`
    `protected Table` | `table`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractWriteResponseHandler(Table table, 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.IMessageCallback

      `isLatencyForSnitch`

- - ### Field Detail

    - #### table

          protected final Table table

    - #### startTime

          protected final long startTime

    - #### naturalEndpoints

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

    - #### consistencyLevel

          protected 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(Table table,
                                      java.util.Collection<java.net.InetAddress> naturalEndpoints,
                                      java.util.Collection<java.net.InetAddress> pendingEndpoints,
                                      ConsistencyLevel consistencyLevel,
                                      java.lang.Runnable callback,
                                      WriteType writeType)

      Parameters:
        `pendingEndpoints` -
        `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