org.apache.cassandra.repair

## Class StreamingRepairTask

- java.lang.Object
- - org.apache.cassandra.repair.StreamingRepairTask

All Implemented Interfaces:
  com.google.common.util.concurrent.FutureCallback<StreamState>, java.lang.Runnable, StreamEventHandler

    public class StreamingRepairTask
    extends java.lang.Object
    implements java.lang.Runnable, StreamEventHandler

Task that make two nodes exchange (stream) some ranges (for a given table/cf). This handle the case where the local node is neither of the two nodes that must stream their range, and allow to register a callback to be called on completion.

### Field Summary

Fields
`RepairJobDesc` `desc` Repair session ID that this streaming task belongs
`SyncRequest` `request`

### Constructor Summary

Constructors
Constructor and Description
`StreamingRepairTask(RepairJobDesc desc, SyncRequest request)`

### Method Summary

Methods
`void` `handleStreamEvent(StreamEvent event)` Callback for various streaming events.
`void` `onFailure(java.lang.Throwable t)` If we failed on either stream in or out, reply fail to the initiator.
`void` `onSuccess(StreamState state)` If we succeeded on both stream in and out, reply back to the initiator.
`void` `run()`

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

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

### Field Detail

#### desc

    public final RepairJobDesc desc

Repair session ID that this streaming task belongs

#### request

    public final SyncRequest request

### Constructor Detail

#### StreamingRepairTask

    public StreamingRepairTask(RepairJobDesc desc,
                       SyncRequest request)

### Method Detail

#### run

    public void run()

Specified by:
  `run` in interface `java.lang.Runnable`

#### handleStreamEvent

    public void handleStreamEvent(StreamEvent event)

Description copied from interface: `StreamEventHandler`
Callback for various streaming events.

Specified by:
  `handleStreamEvent` in interface `StreamEventHandler`
Parameters:
  `event` - Stream event.
See Also:
  `StreamEvent.Type`

#### onSuccess

    public void onSuccess(StreamState state)

If we succeeded on both stream in and out, reply back to the initiator.

Specified by:
  `onSuccess` in interface `com.google.common.util.concurrent.FutureCallback<StreamState>`

#### onFailure

    public void onFailure(java.lang.Throwable t)

If we failed on either stream in or out, reply fail to the initiator.

Specified by:
  `onFailure` in interface `com.google.common.util.concurrent.FutureCallback<StreamState>`