LocalSyncTask (apache-cassandra API)
Date: 2018-02-14

org.apache.cassandra.repair

## Class LocalSyncTask

- java.lang.Object
- - com.google.common.util.concurrent.AbstractFuture<SyncStat>
  - - org.apache.cassandra.repair.SyncTask
    - - org.apache.cassandra.repair.LocalSyncTask

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

      public class LocalSyncTask
      extends SyncTask
      implements StreamEventHandler

  LocalSyncTask performs streaming between local(coordinator) node and remote replica.

- - ### Field Summary

    - ### Fields inherited from class org.apache.cassandra.repair.SyncTask

      `desc, r1, r2, stat`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LocalSyncTask(RepairJobDesc desc, TreeResponse r1, TreeResponse r2, long repairedAt, boolean pullRepair)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `handleStreamEvent(StreamEvent event)` Callback for various streaming events.
    `void` | `onFailure(java.lang.Throwable t)`
    `void` | `onSuccess(StreamState result)`
    `protected void` | `startSync(java.util.List<Range<Token>> differences)` Starts sending/receiving our list of differences to/from the remote endpoint: creates a callback that will be called out of band once the streams complete.

    - ### Methods inherited from class org.apache.cassandra.repair.SyncTask

      `getCurrentStat, run`

    - ### Methods inherited from class com.google.common.util.concurrent.AbstractFuture

      `addListener, cancel, get, get, interruptTask, isCancelled, isDone, set, setException, wasInterrupted`

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

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

- - ### Constructor Detail

    - #### LocalSyncTask

          public LocalSyncTask(RepairJobDesc desc,
                               TreeResponse r1,
                               TreeResponse r2,
                               long repairedAt,
                               boolean pullRepair)

  - ### Method Detail

    - #### startSync

          protected void startSync(java.util.List<Range<Token>> differences)

      Starts sending/receiving our list of differences to/from the remote endpoint: creates a callback that will be called out of band once the streams complete.
      Specified by:
        `startSync` in class `SyncTask`

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

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

    - #### onFailure

          public void onFailure(java.lang.Throwable t)

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

Copyright © 2018 The Apache Software Foundation