Package org.apache.cassandra.streaming
Class StreamResultFuture
- java.lang.Object
-
- com.google.common.util.concurrent.internal.InternalFutureFailureAccess
-
- 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 theStreamSession
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 onStreamEvent
s to track progress of the streaming.
-
-
Field Summary
Fields Modifier and Type Field Description java.util.UUID
planId
StreamOperation
streamOperation
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEventListener(StreamEventHandler listener)
static StreamResultFuture
createFollower(int sessionIndex, java.util.UUID planId, StreamOperation streamOperation, InetAddressAndPort from, io.netty.channel.Channel channel, java.util.UUID pendingRepair, PreviewKind previewKind)
static StreamResultFuture
createInitiator(java.util.UUID planId, StreamOperation streamOperation, java.util.Collection<StreamEventHandler> listeners, StreamCoordinator coordinator)
boolean
equals(java.lang.Object o)
StreamCoordinator
getCoordinator()
StreamState
getCurrentState()
StreamSession
getSession(InetAddressAndPort peer, int sessionIndex)
void
handleProgress(ProgressInfo progress)
int
hashCode()
-
-
-
Field Detail
-
planId
public final java.util.UUID planId
-
streamOperation
public final StreamOperation streamOperation
-
-
Method Detail
-
createInitiator
public static StreamResultFuture createInitiator(java.util.UUID planId, StreamOperation streamOperation, java.util.Collection<StreamEventHandler> listeners, StreamCoordinator coordinator)
-
createFollower
public static StreamResultFuture createFollower(int sessionIndex, java.util.UUID planId, StreamOperation streamOperation, InetAddressAndPort from, io.netty.channel.Channel channel, java.util.UUID pendingRepair, PreviewKind previewKind)
-
getCoordinator
public StreamCoordinator getCoordinator()
-
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 classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
handleProgress
public void handleProgress(ProgressInfo progress)
-
getSession
public StreamSession getSession(InetAddressAndPort peer, int sessionIndex)
-
-