org.apache.cassandra.service

## Class BatchlogResponseHandler<T>

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

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

      public class BatchlogResponseHandler<T>
      extends AbstractWriteResponseHandler<T>

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `BatchlogResponseHandler.BatchlogCleanup`
    `static interface` | `BatchlogResponseHandler.BatchlogCleanupCallback`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `requiredBeforeFinish`

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

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

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

      `isAlive`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BatchlogResponseHandler(AbstractWriteResponseHandler<T> wrapped, int requiredBeforeFinish, BatchlogResponseHandler.BatchlogCleanup cleanup, long queryStartNanoTime)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected int` | `ackCount()`
    `void` | `assureSufficientLiveNodes()`
    `void` | `get()`
    `boolean` | `isLatencyForSnitch()`
    `void` | `onFailure(java.net.InetAddress from, RequestFailureReason failureReason)` Called when there is an exception on the remote node or timeout happens
    `void` | `response(MessageIn<T> msg)` null message means "response from local write"
    `protected void` | `signal()`
    `protected int` | `totalBlockFor()`
    `protected int` | `totalEndpoints()`
    `protected boolean` | `waitingFor(java.net.InetAddress from)`

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

      `currentTimeout, setSupportsBackPressure, supportsBackPressure`

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

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

- - ### Field Detail

    - #### requiredBeforeFinish

          protected volatile int requiredBeforeFinish

  - ### Constructor Detail

    - #### BatchlogResponseHandler

          public BatchlogResponseHandler(AbstractWriteResponseHandler<T> wrapped,
                                         int requiredBeforeFinish,
                                         BatchlogResponseHandler.BatchlogCleanup cleanup,
                                         long queryStartNanoTime)

  - ### Method Detail

    - #### ackCount

          protected int ackCount()

      Specified by:
        `ackCount` in class `AbstractWriteResponseHandler<T>`
      Returns:
        number of responses received

    - #### response

          public void response(MessageIn<T> msg)

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

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

    - #### onFailure

          public void onFailure(java.net.InetAddress from,
                                RequestFailureReason failureReason)

      Description copied from interface: `IAsyncCallbackWithFailure`
      Called when there is an exception on the remote node or timeout happens
      Specified by:
        `onFailure` in interface `IAsyncCallbackWithFailure<T>`
      Overrides:
        `onFailure` in class `AbstractWriteResponseHandler<T>`

    - #### assureSufficientLiveNodes

          public void assureSufficientLiveNodes()

      Overrides:
        `assureSufficientLiveNodes` in class `AbstractWriteResponseHandler<T>`

    - #### get

          public void get()
                   throws WriteTimeoutException,
                          WriteFailureException

      Overrides:
        `get` in class `AbstractWriteResponseHandler<T>`
      Throws:
        `WriteTimeoutException`
        `WriteFailureException`

    - #### totalBlockFor

          protected int totalBlockFor()

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

    - #### totalEndpoints

          protected int totalEndpoints()

      Overrides:
        `totalEndpoints` in class `AbstractWriteResponseHandler<T>`
      Returns:
        the total number of endpoints the request has been sent to.

    - #### waitingFor

          protected boolean waitingFor(java.net.InetAddress from)

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

    - #### signal

          protected void signal()

      Overrides:
        `signal` in class `AbstractWriteResponseHandler<T>`

Copyright © 2018 The Apache Software Foundation