C# Class Kafka.Client.ZooKeeperIntegration.Listeners.BrokerTopicsListener

Listens to new broker registrations under a particular topic, in zookeeper and keeps the related data structures updated
Inheritance: IZooKeeperChildListener
Show file Open project: precog/kafka Class Usage Examples

Public Methods

Method Description
BrokerTopicsListener ( IZooKeeperClient zkclient, IDictionary actualBrokerTopicsPartitionsMap, Broker>.IDictionary actualBrokerIdMap, Action callback ) : System

Initializes a new instance of the BrokerTopicsListener class.

HandleChildChange ( ZooKeeperChildChangedEventArgs e ) : void

Called when the children of the given path changed

ResetState ( ) : void

Resets the state of listener.

Private Methods

Method Description
ProcessBrokerChange ( string path, IEnumerable childs ) : void

Processes change in the broker lists.

ProcessNewBrokerInExistingTopic ( string topic, IEnumerable childs ) : void

Generate the updated mapping of (brokerId, numPartitions) for the new list of brokers registered under some topic.

Method Details

BrokerTopicsListener() public method

Initializes a new instance of the BrokerTopicsListener class.
public BrokerTopicsListener ( IZooKeeperClient zkclient, IDictionary actualBrokerTopicsPartitionsMap, Broker>.IDictionary actualBrokerIdMap, Action callback ) : System
zkclient IZooKeeperClient The wrapper on ZooKeeper client.
actualBrokerTopicsPartitionsMap IDictionary The actual broker topics partitions map.
actualBrokerIdMap Broker>.IDictionary The actual broker id map.
callback Action The callback invoked after new broker is added.
return System

HandleChildChange() public method

Called when the children of the given path changed
public HandleChildChange ( ZooKeeperChildChangedEventArgs e ) : void
e Kafka.Client.ZooKeeperIntegration.Events.ZooKeeperChildChangedEventArgs The instance containing the event data /// as parent path and children (null if parent was deleted). ///
return void

ResetState() public method

Resets the state of listener.
public ResetState ( ) : void
return void