StreamResultFuture (apache-cassandra API)
Date: 2014-10-21

org.apache.cassandra.streaming

## Class StreamResultFuture

- java.lang.Object
- - com.google.common.util.concurrent.AbstractFuture<StreamState>
  - - org.apache.cassandra.streaming.StreamResultFuture

- All Implemented Interfaces:
    com.google.common.util.concurrent.ListenableFuture<StreamState>, java.util.concurrent.Future<StreamState>

      public final class StreamResultFuture
      extends com.google.common.util.concurrent.AbstractFuture<StreamState>

  A future on the result (`StreamState`) of a streaming plan. In practice, this object also groups all the `StreamSession` for the streaming job involved. One StreamSession will be created for every peer involved and said session will handle every streaming (outgoing and incoming) to that peer for this job.

  The future will return a result once every session is completed (successfully or not). If any session ended up with an error, the future will throw a StreamException.

  You can attach `StreamEventHandler` to this object to listen on `StreamEvent`s to track progress of the streaming.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `java.lang.String` | `description`
    `java.util.UUID` | `planId`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addEventListener(StreamEventHandler listener)`
    `boolean` | `equals(java.lang.Object o)`
    `StreamState` | `getCurrentState()`
    `void` | `handleProgress(ProgressInfo progress)`
    `int` | `hashCode()`
    `static StreamResultFuture` | `initReceivingSide(int sessionIndex, java.util.UUID planId, java.lang.String description, java.net.InetAddress from, java.net.Socket socket, boolean isForOutgoing, int version)`

    - ### 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, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### planId

          public final java.util.UUID planId

    - #### description

          public final java.lang.String description

  - ### Method Detail

    - #### initReceivingSide

          public static StreamResultFuture initReceivingSide(int sessionIndex,
                                             java.util.UUID planId,
                                             java.lang.String description,
                                             java.net.InetAddress from,
                                             java.net.Socket socket,
                                             boolean isForOutgoing,
                                             int version)
                                                      throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### addEventListener

          public void addEventListener(StreamEventHandler listener)

    - #### getCurrentState

          public StreamState getCurrentState()

      Returns:
        Current snapshot of streaming progress.

    - #### equals

          public boolean equals(java.lang.Object o)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### handleProgress

          public void handleProgress(ProgressInfo progress)

Copyright © 2014 The Apache Software Foundation