|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.zookeeper.ClientCnxn
public class ClientCnxn
This class manages the socket i/o for the client. ClientCnxn maintains a list of available servers to connect to and "transparently" switches servers it is connected to as needed.
Field Summary | |
---|---|
static int |
packetLen
|
Constructor Summary | |
---|---|
ClientCnxn(String hosts,
int sessionTimeout,
ZooKeeper zooKeeper,
ClientWatchManager watcher)
Creates a connection object. |
|
ClientCnxn(String hosts,
int sessionTimeout,
ZooKeeper zooKeeper,
ClientWatchManager watcher,
long sessionId,
byte[] sessionPasswd)
Creates a connection object. |
Method Summary | |
---|---|
void |
addAuthInfo(String scheme,
byte[] auth)
|
void |
close()
Close the connection, which includes; send session disconnect to the server, shutdown the send/event threads. |
void |
disconnect()
Shutdown the send/event threads. |
static boolean |
getDisableAutoResetWatch()
tests use this to check on reset of watches |
long |
getSessionId()
|
byte[] |
getSessionPasswd()
|
static void |
setDisableAutoResetWatch(boolean b)
tests use this to set the auto reset |
void |
start()
|
org.apache.zookeeper.proto.ReplyHeader |
submitRequest(org.apache.zookeeper.proto.RequestHeader h,
Record request,
Record response,
org.apache.zookeeper.ZooKeeper.WatchRegistration watchRegistration)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int packetLen
Constructor Detail |
---|
public ClientCnxn(String hosts, int sessionTimeout, ZooKeeper zooKeeper, ClientWatchManager watcher) throws IOException
hosts
- a comma separated list of hosts that can be connected to.sessionTimeout
- the timeout for connections.zooKeeper
- the zookeeper object that this connection is related to.watcher
- watcher for this connection
IOException
public ClientCnxn(String hosts, int sessionTimeout, ZooKeeper zooKeeper, ClientWatchManager watcher, long sessionId, byte[] sessionPasswd) throws IOException
hosts
- a comma separated list of hosts that can be connected to.sessionTimeout
- the timeout for connections.zooKeeper
- the zookeeper object that this connection is related to.watcher
- watcher for this connectionsessionId
- session id if re-establishing sessionsessionPasswd
- session passwd if re-establishing session
IOException
Method Detail |
---|
public long getSessionId()
public byte[] getSessionPasswd()
public String toString()
toString
in class Object
public static boolean getDisableAutoResetWatch()
public static void setDisableAutoResetWatch(boolean b)
b
- the vaued to set disable watches topublic void start()
public void disconnect()
public void close() throws IOException
IOException
public org.apache.zookeeper.proto.ReplyHeader submitRequest(org.apache.zookeeper.proto.RequestHeader h, Record request, Record response, org.apache.zookeeper.ZooKeeper.WatchRegistration watchRegistration) throws InterruptedException
InterruptedException
public void addAuthInfo(String scheme, byte[] auth)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |