org.apache.s4.comm.topology
Class RemoteStreams

java.lang.Object
  extended by org.apache.s4.comm.topology.RemoteStreams
All Implemented Interfaces:
org.I0Itec.zkclient.IZkChildListener, org.I0Itec.zkclient.IZkStateListener

public class RemoteStreams
extends java.lang.Object
implements org.I0Itec.zkclient.IZkStateListener, org.I0Itec.zkclient.IZkChildListener

Monitors streams available in the S4 cluster.

Maintains a data structure reflecting the currently published streams with their consumers and publishers.

Provides methods to publish producers and consumers of streams


Nested Class Summary
static class RemoteStreams.StreamType
           
 
Constructor Summary
RemoteStreams(java.lang.String zookeeperAddress, int sessionTimeout, int connectionTimeout)
           
 
Method Summary
 void addInputStream(int appId, java.lang.String clusterName, java.lang.String streamName)
          Publishes interest in a stream from an application.
 void addOutputStream(java.lang.String appId, java.lang.String clusterName, java.lang.String streamName)
           
 java.util.Set<StreamConsumer> getConsumers(java.lang.String streamName)
           
 void handleChildChange(java.lang.String paramString, java.util.List<java.lang.String> paramList)
           
 void handleNewSession()
           
 void handleStateChanged(org.apache.zookeeper.Watcher.Event.KeeperState state)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteStreams

@Inject
public RemoteStreams(java.lang.String zookeeperAddress,
                            int sessionTimeout,
                            int connectionTimeout)
              throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getConsumers

public java.util.Set<StreamConsumer> getConsumers(java.lang.String streamName)

handleStateChanged

public void handleStateChanged(org.apache.zookeeper.Watcher.Event.KeeperState state)
                        throws java.lang.Exception
Specified by:
handleStateChanged in interface org.I0Itec.zkclient.IZkStateListener
Throws:
java.lang.Exception

handleNewSession

public void handleNewSession()
                      throws java.lang.Exception
Specified by:
handleNewSession in interface org.I0Itec.zkclient.IZkStateListener
Throws:
java.lang.Exception

handleChildChange

public void handleChildChange(java.lang.String paramString,
                              java.util.List<java.lang.String> paramList)
                       throws java.lang.Exception
Specified by:
handleChildChange in interface org.I0Itec.zkclient.IZkChildListener
Throws:
java.lang.Exception

addOutputStream

public void addOutputStream(java.lang.String appId,
                            java.lang.String clusterName,
                            java.lang.String streamName)

addInputStream

public void addInputStream(int appId,
                           java.lang.String clusterName,
                           java.lang.String streamName)
Publishes interest in a stream from an application.

Parameters:
appId -
clusterName -
streamName -