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 and Description
`StreamCoordinator(int connectionsPerHost, boolean keepSSTableLevel, boolean isIncremental, StreamConnectionFactory factory, boolean connectSequentially)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addSessionInfo(SessionInfo session)`
`void` `connect(StreamResultFuture future)`
`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)`
`void` `transferFiles(java.net.InetAddress to, java.util.Collection<StreamSession.SSTableStreamingSections> sstableDetails)`
`void` `updateProgress(ProgressInfo info)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### StreamCoordinator

    public StreamCoordinator(int connectionsPerHost,
                             boolean keepSSTableLevel,
                             boolean isIncremental,
                             StreamConnectionFactory factory,
                             boolean connectSequentially)

### Method Detail

#### setConnectionFactory

    public void setConnectionFactory(StreamConnectionFactory factory)

#### hasActiveSessions

    public boolean hasActiveSessions()

Returns:
  true if any stream session is active

#### getAllStreamSessions

    public java.util.Collection<StreamSession> getAllStreamSessions()

#### isReceiving

    public boolean isReceiving()

#### connect

    public void connect(StreamResultFuture future)

#### getPeers

    public java.util.Set<java.net.InetAddress> getPeers()

#### getOrCreateNextSession

    public StreamSession getOrCreateNextSession(java.net.InetAddress peer,
                                                java.net.InetAddress connecting)

#### getOrCreateSessionById

    public StreamSession getOrCreateSessionById(java.net.InetAddress peer,
                                                int id,
                                                java.net.InetAddress connecting)

#### updateProgress

    public void updateProgress(ProgressInfo info)

#### addSessionInfo

    public void addSessionInfo(SessionInfo session)

#### getAllSessionInfo

    public java.util.Set<SessionInfo> getAllSessionInfo()

#### transferFiles

    public void transferFiles(java.net.InetAddress to,
                              java.util.Collection<StreamSession.SSTableStreamingSections> sstableDetails)