Package org.apache.cassandra.streaming
Class StreamCoordinator
- java.lang.Object
-
- org.apache.cassandra.streaming.StreamCoordinator
-
public class StreamCoordinator extends java.lang.ObjectStreamCoordinatoris a helper class that abstracts away maintaining multiple StreamSession and ProgressInfo instances per peer. This class coordinates multiple SessionStreams per peer in both the outgoing StreamPlan context and on the inbound StreamResultFuture context.
-
-
Constructor Summary
Constructors Constructor Description StreamCoordinator(StreamOperation streamOperation, int connectionsPerHost, StreamingChannel.Factory factory, boolean follower, boolean connectSequentially, TimeUUID pendingRepair, PreviewKind previewKind)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSessionInfo(SessionInfo session)voidconnect(StreamResultFuture future)java.util.Set<SessionInfo>getAllSessionInfo()java.util.Collection<StreamSession>getAllStreamSessions()StreamSessiongetOrCreateInboundSession(InetAddressAndPort from, StreamingChannel channel, int messagingVersion, int id)StreamSessiongetOrCreateOutboundSession(InetAddressAndPort peer)java.util.Set<java.net.InetSocketAddress>getPeers()TimeUUIDgetPendingRepair()StreamSessiongetSessionById(InetAddressAndPort peer, int id)booleanhasActiveSessions()booleanisFollower()voidsetConnectionFactory(StreamingChannel.Factory factory)voidtransferStreams(InetAddressAndPort to, java.util.Collection<OutgoingStream> streams)voidupdateProgress(ProgressInfo info)
-
-
-
Constructor Detail
-
StreamCoordinator
public StreamCoordinator(StreamOperation streamOperation, int connectionsPerHost, StreamingChannel.Factory factory, boolean follower, boolean connectSequentially, TimeUUID pendingRepair, PreviewKind previewKind)
-
-
Method Detail
-
setConnectionFactory
public void setConnectionFactory(StreamingChannel.Factory factory)
-
hasActiveSessions
public boolean hasActiveSessions()
- Returns:
- true if any stream session is active
-
getAllStreamSessions
public java.util.Collection<StreamSession> getAllStreamSessions()
-
isFollower
public boolean isFollower()
-
connect
public void connect(StreamResultFuture future)
-
getPeers
public java.util.Set<java.net.InetSocketAddress> getPeers()
-
getOrCreateOutboundSession
public StreamSession getOrCreateOutboundSession(InetAddressAndPort peer)
-
getOrCreateInboundSession
public StreamSession getOrCreateInboundSession(InetAddressAndPort from, StreamingChannel channel, int messagingVersion, int id)
-
getSessionById
public StreamSession getSessionById(InetAddressAndPort peer, int id)
-
updateProgress
public void updateProgress(ProgressInfo info)
-
addSessionInfo
public void addSessionInfo(SessionInfo session)
-
getAllSessionInfo
public java.util.Set<SessionInfo> getAllSessionInfo()
-
transferStreams
public void transferStreams(InetAddressAndPort to, java.util.Collection<OutgoingStream> streams)
-
getPendingRepair
public TimeUUID getPendingRepair()
-
-