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 theStreamSessionfor 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
StreamEventHandlerto this object to listen onStreamEvents to track progress of the streaming.
-
-
Field Summary
Fields Modifier and Type Field Description java.util.UUIDplanIdStreamOperationstreamOperation
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEventListener(StreamEventHandler listener)static StreamResultFuturecreateFollower(int sessionIndex, java.util.UUID planId, StreamOperation streamOperation, InetAddressAndPort from, io.netty.channel.Channel channel, java.util.UUID pendingRepair, PreviewKind previewKind)static StreamResultFuturecreateInitiator(java.util.UUID planId, StreamOperation streamOperation, java.util.Collection<StreamEventHandler> listeners, StreamCoordinator coordinator)booleanequals(java.lang.Object o)StreamCoordinatorgetCoordinator()StreamStategetCurrentState()StreamSessiongetSession(InetAddressAndPort peer, int sessionIndex)voidhandleProgress(ProgressInfo progress)inthashCode()
-
-
-
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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
handleProgress
public void handleProgress(ProgressInfo progress)
-
getSession
public StreamSession getSession(InetAddressAndPort peer, int sessionIndex)
-
-