org.apache.cassandra.service

## Class ReadCallback<TMessage,TResolved>

- java.lang.Object
- - org.apache.cassandra.service.ReadCallback<TMessage,TResolved>

- All Implemented Interfaces:
    IAsyncCallback<TMessage>, IMessageCallback

      public class ReadCallback<TMessage,TResolved>
      extends java.lang.Object
      implements IAsyncCallback<TMessage>

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static org.slf4j.Logger` | `logger`
    `IResponseResolver<TMessage,TResolved>` | `resolver`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReadCallback(IResponseResolver<TMessage,TResolved> resolver, ConsistencyLevel consistencyLevel, IReadCommand command, java.util.List<java.net.InetAddress> filteredEndpoints)` Constructor when response count has to be calculated and blocked for.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `assureSufficientLiveNodes()`
    `TResolved` | `get()`
    `int` | `getReceivedCount()`
    `boolean` | `isLatencyForSnitch()`
    `protected void` | `maybeResolveForRepair()` Check digests in the background on the Repair stage if we've received replies too all the requests we sent.
    `void` | `response(MessageIn<TMessage> message)`
    `void` | `response(TMessage result)`
    `ReadCallback<TMessage,TResolved>` | `withNewResolver(IResponseResolver<TMessage,TResolved> newResolver)`

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

    - #### resolver

          public final IResponseResolver<TMessage,TResolved> resolver

  - ### Constructor Detail

    - #### ReadCallback

          public ReadCallback(IResponseResolver<TMessage,TResolved> resolver,
                      ConsistencyLevel consistencyLevel,
                      IReadCommand command,
                      java.util.List<java.net.InetAddress> filteredEndpoints)

      Constructor when response count has to be calculated and blocked for.

  - ### Method Detail

    - #### withNewResolver

          public ReadCallback<TMessage,TResolved> withNewResolver(IResponseResolver<TMessage,TResolved> newResolver)

    - #### get

          public TResolved get()
                        throws ReadTimeoutException,
                               DigestMismatchException

      Throws:
        `ReadTimeoutException`
        `DigestMismatchException`

    - #### response

          public void response(MessageIn<TMessage> message)

      Specified by:
        `response` in interface `IAsyncCallback<TMessage>`
      Parameters:
        `message` - response received.

    - #### getReceivedCount

          public int getReceivedCount()

      Returns:
        the current number of received responses

    - #### response

          public void response(TMessage result)

    - #### maybeResolveForRepair

          protected void maybeResolveForRepair()

      Check digests in the background on the Repair stage if we've received replies too all the requests we sent.

    - #### assureSufficientLiveNodes

          public void assureSufficientLiveNodes()
                                         throws UnavailableException

      Throws:
        `UnavailableException`

    - #### isLatencyForSnitch

          public boolean isLatencyForSnitch()

      Specified by:
        `isLatencyForSnitch` in interface `IMessageCallback`
      Returns:
        true if this callback is on the read path and its latency should be given as input to the dynamic snitch.

Copyright © 2014 The Apache Software Foundation