C# Class Kafka.Client.ZooKeeperIntegration.ZooKeeperClient

ファイルを表示 Open project: precog/kafka Class Usage Examples

Public Methods

Method Description
Process ( ZooKeeperNet.WatchedEvent e ) : void

Processes ZooKeeper event

Requires installed watcher

Subscribe ( IZooKeeperStateListener listener ) : void

Subscribes listeners on ZooKeeper state changes events

Subscribe ( string path, IZooKeeperChildListener listener ) : void

Subscribes listeners on ZooKeeper child changes under given path

Subscribe ( string path, IZooKeeperDataListener listener ) : void

Subscribes listeners on ZooKeeper data changes under given path

Unsubscribe ( IZooKeeperStateListener listener ) : void

Un-subscribes listeners on ZooKeeper state changes events

Unsubscribe ( string path, IZooKeeperChildListener listener ) : void

Un-subscribes listeners on ZooKeeper child changes under given path

Unsubscribe ( string path, IZooKeeperDataListener listener ) : void

Un-subscribes listeners on ZooKeeper data changes under given path

UnsubscribeAll ( ) : void

Un-subscribes all listeners

WatchForChilds ( string path ) : IList

Installs a child watch for the given path.

WatchForData ( string path ) : void

Installs a data watch for the given path.

Private Methods

Method Description
Dequeue ( ) : void

Dequeues event from events queue and invokes subscribed handlers

Enqueue ( ZooKeeperEventArgs e ) : void

Enqueues new event from ZooKeeper in events queue

HasListeners ( string path ) : bool

Checks whether any data or child listeners are registered

OnChildChanged ( ZooKeeperChildChangedEventArgs e ) : void

Invokes subscribed handlers for ZooKeeeper child changes event

OnDataChanged ( ZooKeeperDataChangedEventArgs e ) : void

Invokes subscribed handlers for ZooKeeeper data changes event

OnSessionCreated ( ZooKeeperSessionCreatedEventArgs e ) : void

Invokes subscribed handlers for ZooKeeeper session re-creates event

OnStateChanged ( ZooKeeperStateChangedEventArgs e ) : void

Invokes subscribed handlers for ZooKeeeper state changes event

PoolEventsQueue ( ) : void

Pools ZooKeeper events form events queue

Thread sleeps if queue is empty

ProcessDataOrChildChange ( ZooKeeperNet.WatchedEvent e ) : void

Processess ZooKeeper childs or data changes events

ProcessStateChange ( ZooKeeperNet.WatchedEvent e ) : void

Processess ZooKeeper state changes events

RunEventWorker ( ) : void

Event thread starting method

Method Details

Process() public method

Processes ZooKeeper event
Requires installed watcher
public Process ( ZooKeeperNet.WatchedEvent e ) : void
e ZooKeeperNet.WatchedEvent /// The event data. ///
return void

Subscribe() public method

Subscribes listeners on ZooKeeper state changes events
public Subscribe ( IZooKeeperStateListener listener ) : void
listener IZooKeeperStateListener /// The listener. ///
return void

Subscribe() public method

Subscribes listeners on ZooKeeper child changes under given path
public Subscribe ( string path, IZooKeeperChildListener listener ) : void
path string /// The parent path. ///
listener IZooKeeperChildListener /// The listener. ///
return void

Subscribe() public method

Subscribes listeners on ZooKeeper data changes under given path
public Subscribe ( string path, IZooKeeperDataListener listener ) : void
path string /// The parent path. ///
listener IZooKeeperDataListener /// The listener. ///
return void

Unsubscribe() public method

Un-subscribes listeners on ZooKeeper state changes events
public Unsubscribe ( IZooKeeperStateListener listener ) : void
listener IZooKeeperStateListener /// The listener. ///
return void

Unsubscribe() public method

Un-subscribes listeners on ZooKeeper child changes under given path
public Unsubscribe ( string path, IZooKeeperChildListener listener ) : void
path string /// The parent path. ///
listener IZooKeeperChildListener /// The listener. ///
return void

Unsubscribe() public method

Un-subscribes listeners on ZooKeeper data changes under given path
public Unsubscribe ( string path, IZooKeeperDataListener listener ) : void
path string /// The parent path. ///
listener IZooKeeperDataListener /// The listener. ///
return void

UnsubscribeAll() public method

Un-subscribes all listeners
public UnsubscribeAll ( ) : void
return void

WatchForChilds() public method

Installs a child watch for the given path.
public WatchForChilds ( string path ) : IList
path string /// The parent path. ///
return IList

WatchForData() public method

Installs a data watch for the given path.
public WatchForData ( string path ) : void
path string /// The parent path. ///
return void