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 and Description |
---|
StreamCoordinator(StreamOperation streamOperation,
int connectionsPerHost,
StreamConnectionFactory factory,
boolean follower,
boolean connectSequentially,
java.util.UUID pendingRepair,
PreviewKind previewKind) |
Modifier and Type | Method and Description |
---|---|
void |
addSessionInfo(SessionInfo session) |
void |
connect(StreamResultFuture future) |
java.util.Set<SessionInfo> |
getAllSessionInfo() |
java.util.Collection<StreamSession> |
getAllStreamSessions() |
StreamSession |
getOrCreateNextSession(InetAddressAndPort peer) |
StreamSession |
getOrCreateSessionById(InetAddressAndPort peer,
int id) |
java.util.Set<InetAddressAndPort> |
getPeers() |
java.util.UUID |
getPendingRepair() |
StreamSession |
getSessionById(InetAddressAndPort peer,
int id) |
boolean |
hasActiveSessions() |
boolean |
isFollower() |
void |
setConnectionFactory(StreamConnectionFactory factory) |
void |
transferStreams(InetAddressAndPort to,
java.util.Collection<OutgoingStream> streams) |
void |
updateProgress(ProgressInfo info) |
public StreamCoordinator(StreamOperation streamOperation, int connectionsPerHost, StreamConnectionFactory factory, boolean follower, boolean connectSequentially, java.util.UUID pendingRepair, PreviewKind previewKind)
public void setConnectionFactory(StreamConnectionFactory factory)
public boolean hasActiveSessions()
public java.util.Collection<StreamSession> getAllStreamSessions()
public boolean isFollower()
public void connect(StreamResultFuture future)
public java.util.Set<InetAddressAndPort> getPeers()
public StreamSession getOrCreateNextSession(InetAddressAndPort peer)
public StreamSession getOrCreateSessionById(InetAddressAndPort peer, int id)
public StreamSession getSessionById(InetAddressAndPort peer, int id)
public void updateProgress(ProgressInfo info)
public void addSessionInfo(SessionInfo session)
public java.util.Set<SessionInfo> getAllSessionInfo()
public void transferStreams(InetAddressAndPort to, java.util.Collection<OutgoingStream> streams)
public java.util.UUID getPendingRepair()
Copyright © 2009-2022 The Apache Software Foundation