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(int connectionsPerHost,
boolean keepSSTableLevel,
boolean isIncremental,
StreamConnectionFactory factory) |
Modifier and Type | Method and Description |
---|---|
void |
addSessionInfo(SessionInfo session) |
void |
connectAllStreamSessions() |
java.util.Set<SessionInfo> |
getAllSessionInfo() |
java.util.Collection<StreamSession> |
getAllStreamSessions() |
StreamSession |
getOrCreateNextSession(java.net.InetAddress peer,
java.net.InetAddress connecting) |
StreamSession |
getOrCreateSessionById(java.net.InetAddress peer,
int id,
java.net.InetAddress connecting) |
java.util.Set<java.net.InetAddress> |
getPeers() |
boolean |
hasActiveSessions() |
boolean |
isReceiving() |
void |
setConnectionFactory(StreamConnectionFactory factory) |
static void |
shutdownAndWait(long timeout,
java.util.concurrent.TimeUnit unit) |
void |
transferFiles(java.net.InetAddress to,
java.util.Collection<StreamSession.SSTableStreamingSections> sstableDetails) |
void |
updateProgress(ProgressInfo info) |
public StreamCoordinator(int connectionsPerHost, boolean keepSSTableLevel, boolean isIncremental, StreamConnectionFactory factory)
public void setConnectionFactory(StreamConnectionFactory factory)
public boolean hasActiveSessions()
public java.util.Collection<StreamSession> getAllStreamSessions()
public boolean isReceiving()
public void connectAllStreamSessions()
public java.util.Set<java.net.InetAddress> getPeers()
public StreamSession getOrCreateNextSession(java.net.InetAddress peer, java.net.InetAddress connecting)
public StreamSession getOrCreateSessionById(java.net.InetAddress peer, int id, java.net.InetAddress connecting)
public void updateProgress(ProgressInfo info)
public void addSessionInfo(SessionInfo session)
public java.util.Set<SessionInfo> getAllSessionInfo()
public void transferFiles(java.net.InetAddress to, java.util.Collection<StreamSession.SSTableStreamingSections> sstableDetails)
public static void shutdownAndWait(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException
java.lang.InterruptedException
java.util.concurrent.TimeoutException
Copyright © 2019 The Apache Software Foundation