Package org.apache.cassandra.streaming
Class StreamCoordinator
- java.lang.Object
-
- org.apache.cassandra.streaming.StreamCoordinator
-
public class StreamCoordinator extends java.lang.Object
StreamCoordinator
is 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 void
addSessionInfo(SessionInfo session)
void
connect(StreamResultFuture future)
java.util.Set<SessionInfo>
getAllSessionInfo()
java.util.Collection<StreamSession>
getAllStreamSessions()
StreamSession
getOrCreateInboundSession(InetAddressAndPort from, StreamingChannel channel, int messagingVersion, int id)
StreamSession
getOrCreateOutboundSession(InetAddressAndPort peer)
java.util.Set<java.net.InetSocketAddress>
getPeers()
TimeUUID
getPendingRepair()
StreamSession
getSessionById(InetAddressAndPort peer, int id)
boolean
hasActiveSessions()
boolean
isFollower()
void
setConnectionFactory(StreamingChannel.Factory factory)
void
transferStreams(InetAddressAndPort to, java.util.Collection<OutgoingStream> streams)
void
updateProgress(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()
-
-