C# Class Kafka.Client.ZooKeeperIntegration.ZooKeeperConnection

Abstracts connection with ZooKeeper server
Inheritance: IZooKeeperConnection
Show file Open project: precog/kafka Class Usage Examples

Public Methods

Method Description
Connect ( IWatcher watcher ) : void

Connects to ZooKeeper server

Create ( string path, byte data, ZooKeeperNet.CreateMode mode ) : string

Creates znode using given create mode for given path and writes given data to it

Delete ( string path ) : void

Deletes znode for a given path

Dispose ( ) : void

Closes underlying ZooKeeper client

Exists ( string path, bool watch ) : bool

Checks whether znode for a given path exists.

GetChildren ( string path, bool watch ) : IList

Gets all children for a given path

GetCreateTime ( string path ) : long

Gets time when connetion was created

ReadData ( string path, Org.Apache.Zookeeper.Data.Stat stats, bool watch ) : byte[]

Fetches data from a given path in ZooKeeper

WriteData ( string path, byte data ) : void

Writes data for a given path

WriteData ( string path, byte data, int version ) : void

Writes data for a given path

ZooKeeperConnection ( string servers ) : System

Initializes a new instance of the ZooKeeperConnection class.

ZooKeeperConnection ( string servers, int sessionTimeout ) : System

Initializes a new instance of the ZooKeeperConnection class.

Private Methods

Method Description
EnsuresNotDisposed ( ) : void

Ensures object wasn't disposed

Method Details

Connect() public method

Connects to ZooKeeper server
public Connect ( IWatcher watcher ) : void
watcher IWatcher /// The watcher to be installed in ZooKeeper. ///
return void

Create() public method

Creates znode using given create mode for given path and writes given data to it
public Create ( string path, byte data, ZooKeeperNet.CreateMode mode ) : string
path string /// The given path. ///
data byte /// The data to write. ///
mode ZooKeeperNet.CreateMode /// The create mode. ///
return string

Delete() public method

Deletes znode for a given path
public Delete ( string path ) : void
path string /// The given path. ///
return void

Dispose() public method

Closes underlying ZooKeeper client
public Dispose ( ) : void
return void

Exists() public method

Checks whether znode for a given path exists.
public Exists ( string path, bool watch ) : bool
path string /// The given path. ///
watch bool /// Indicates whether should reinstall watcher in ZooKeeper. ///
return bool

GetChildren() public method

Gets all children for a given path
public GetChildren ( string path, bool watch ) : IList
path string /// The given path. ///
watch bool /// Indicates whether should reinstall watcher in ZooKeeper. ///
return IList

GetCreateTime() public method

Gets time when connetion was created
public GetCreateTime ( string path ) : long
path string /// The path. ///
return long

ReadData() public method

Fetches data from a given path in ZooKeeper
public ReadData ( string path, Org.Apache.Zookeeper.Data.Stat stats, bool watch ) : byte[]
path string /// The given path. ///
stats Org.Apache.Zookeeper.Data.Stat /// The statistics. ///
watch bool /// Indicates whether should reinstall watcher in ZooKeeper. ///
return byte[]

WriteData() public method

Writes data for a given path
public WriteData ( string path, byte data ) : void
path string /// The given path. ///
data byte /// The data to write. ///
return void

WriteData() public method

Writes data for a given path
public WriteData ( string path, byte data, int version ) : void
path string /// The given path. ///
data byte /// The data to write. ///
version int /// Expected version of data ///
return void

ZooKeeperConnection() public method

Initializes a new instance of the ZooKeeperConnection class.
public ZooKeeperConnection ( string servers ) : System
servers string /// The list of ZooKeeper servers. ///
return System

ZooKeeperConnection() public method

Initializes a new instance of the ZooKeeperConnection class.
public ZooKeeperConnection ( string servers, int sessionTimeout ) : System
servers string /// The list of ZooKeeper servers. ///
sessionTimeout int /// The session timeout. ///
return System