Package org.apache.cassandra.streaming
Class StreamResultFuture
java.lang.Object
org.apache.cassandra.utils.concurrent.AbstractFuture<V>
org.apache.cassandra.utils.concurrent.AsyncFuture<StreamState>
org.apache.cassandra.streaming.StreamResultFuture
- All Implemented Interfaces:
com.google.common.util.concurrent.ListenableFuture<StreamState>,io.netty.util.concurrent.Future<StreamState>,Future<StreamState>,Awaitable,Future<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 StreamEvents to
track progress of the streaming.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.cassandra.utils.concurrent.Awaitable
Awaitable.AbstractAwaitable, Awaitable.AsyncAwaitable, Awaitable.Defaults, Awaitable.SyncAwaitable -
Field Summary
FieldsFields inherited from class org.apache.cassandra.utils.concurrent.AbstractFuture
CANCELLED, UNCANCELLABLE, UNSET -
Constructor Summary
ConstructorsConstructorDescriptionStreamResultFuture(TimeUUID planId, StreamOperation streamOperation, StreamCoordinator coordinator) Create new StreamResult of givenplanIdand streamOperation.StreamResultFuture(TimeUUID planId, StreamOperation streamOperation, TimeUUID pendingRepair, PreviewKind previewKind) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventListener(StreamEventHandler listener) static StreamResultFuturecreateFollower(int sessionIndex, TimeUUID planId, StreamOperation streamOperation, InetAddressAndPort from, StreamingChannel channel, int messagingVersion, TimeUUID pendingRepair, PreviewKind previewKind) static StreamResultFuturecreateInitiator(TimeUUID planId, StreamOperation streamOperation, Collection<StreamEventHandler> listeners, StreamCoordinator coordinator) booleangetSession(InetAddressAndPort peer, int sessionIndex) voidhandleProgress(ProgressInfo progress) inthashCode()Methods inherited from class org.apache.cassandra.utils.concurrent.AsyncFuture
await, awaitUntil, flatMap, mapMethods inherited from class org.apache.cassandra.utils.concurrent.AbstractFuture
addCallback, addCallback, addCallback, addCallback, addCallback, addCallback, addListener, addListener, addListener, addListeners, await, awaitThrowUncheckedOnInterrupt, awaitThrowUncheckedOnInterrupt, awaitUninterruptibly, awaitUninterruptibly, awaitUntilThrowUncheckedOnInterrupt, awaitUntilUninterruptibly, cancel, cause, description, flatMap, get, get, getNow, getWhenDone, isCancellable, isCancelled, isDone, isSuccess, isUncancellable, map, map, notifyExecutor, removeListener, removeListeners, setUncancellable, setUncancellableExclusive, toString, tryFailure, trySuccessMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.cassandra.utils.concurrent.Future
await, awaitUninterruptibly, flatMap, rethrowIfFailed, sync, syncThrowUncheckedOnInterrupt, syncUninterruptibly
-
Field Details
-
planId
-
streamOperation
-
-
Constructor Details
-
StreamResultFuture
public StreamResultFuture(TimeUUID planId, StreamOperation streamOperation, StreamCoordinator coordinator) Create new StreamResult of givenplanIdand streamOperation. Constructor is package private. You need to useStreamPlan.execute()to get the instance.- Parameters:
planId- Stream plan IDstreamOperation- Stream streamOperation
-
StreamResultFuture
public StreamResultFuture(TimeUUID planId, StreamOperation streamOperation, TimeUUID pendingRepair, PreviewKind previewKind)
-
-
Method Details
-
createInitiator
public static StreamResultFuture createInitiator(TimeUUID planId, StreamOperation streamOperation, Collection<StreamEventHandler> listeners, StreamCoordinator coordinator) -
createFollower
public static StreamResultFuture createFollower(int sessionIndex, TimeUUID planId, StreamOperation streamOperation, InetAddressAndPort from, StreamingChannel channel, int messagingVersion, TimeUUID pendingRepair, PreviewKind previewKind) -
getCoordinator
-
addEventListener
-
getCurrentState
- Returns:
- Current snapshot of streaming progress.
-
equals
-
hashCode
public int hashCode() -
handleProgress
-
getSession
-