|
||||||||||
| 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
|
ZooKeeperSaslClient |
zooKeeperSaslClient
|
| Constructor Summary | |
|---|---|
ClientCnxn(String chrootPath,
HostProvider hostProvider,
int sessionTimeout,
ZooKeeper zooKeeper,
ClientWatchManager watcher,
org.apache.zookeeper.ClientCnxnSocket clientCnxnSocket,
boolean canBeReadOnly)
Creates a connection object. |
|
ClientCnxn(String chrootPath,
HostProvider hostProvider,
int sessionTimeout,
ZooKeeper zooKeeper,
ClientWatchManager watcher,
org.apache.zookeeper.ClientCnxnSocket clientCnxnSocket,
long sessionId,
byte[] sessionPasswd,
boolean canBeReadOnly)
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. |
void |
enableWrite()
|
static boolean |
getDisableAutoResetWatch()
tests use this to check on reset of watches |
long |
getLastZxid()
|
long |
getSessionId()
|
byte[] |
getSessionPasswd()
|
int |
getSessionTimeout()
|
int |
getXid()
|
void |
sendPacket(org.apache.jute.Record request,
org.apache.jute.Record response,
AsyncCallback cb,
int opCode)
|
static void |
setDisableAutoResetWatch(boolean b)
tests use this to set the auto reset |
void |
start()
|
ReplyHeader |
submitRequest(RequestHeader h,
org.apache.jute.Record request,
org.apache.jute.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 ZooKeeperSaslClient zooKeeperSaslClient
public static final int packetLen
| Constructor Detail |
|---|
public ClientCnxn(String chrootPath,
HostProvider hostProvider,
int sessionTimeout,
ZooKeeper zooKeeper,
ClientWatchManager watcher,
org.apache.zookeeper.ClientCnxnSocket clientCnxnSocket,
boolean canBeReadOnly)
throws IOException
chrootPath - - the chroot of this client. Should be removed from this Class in ZOOKEEPER-838hostProvider - the list of ZooKeeper servers to connect tosessionTimeout - the timeout for connections.zooKeeper - the zookeeper object that this connection is related to.watcher - watcher for this connectionclientCnxnSocket - the socket implementation used (e.g. NIO/Netty)canBeReadOnly - whether the connection is allowed to go to read-only
mode in case of partitioning
IOException
public ClientCnxn(String chrootPath,
HostProvider hostProvider,
int sessionTimeout,
ZooKeeper zooKeeper,
ClientWatchManager watcher,
org.apache.zookeeper.ClientCnxnSocket clientCnxnSocket,
long sessionId,
byte[] sessionPasswd,
boolean canBeReadOnly)
chrootPath - - the chroot of this client. Should be removed from this Class in ZOOKEEPER-838hostProvider - the list of ZooKeeper servers to connect tosessionTimeout - the timeout for connections.zooKeeper - the zookeeper object that this connection is related to.watcher - watcher for this connectionclientCnxnSocket - the socket implementation used (e.g. NIO/Netty)sessionId - session id if re-establishing sessionsessionPasswd - session passwd if re-establishing sessioncanBeReadOnly - whether the connection is allowed to go to read-only
mode in case of partitioning
IOException| Method Detail |
|---|
public long getSessionId()
public byte[] getSessionPasswd()
public int getSessionTimeout()
public String toString()
toString in class Objectpublic static boolean getDisableAutoResetWatch()
public static void setDisableAutoResetWatch(boolean b)
b - the value to set disable watches topublic void start()
public long getLastZxid()
public void disconnect()
public void close()
throws IOException
IOExceptionpublic int getXid()
public ReplyHeader submitRequest(RequestHeader h,
org.apache.jute.Record request,
org.apache.jute.Record response,
org.apache.zookeeper.ZooKeeper.WatchRegistration watchRegistration)
throws InterruptedException
InterruptedExceptionpublic void enableWrite()
public void sendPacket(org.apache.jute.Record request,
org.apache.jute.Record response,
AsyncCallback cb,
int opCode)
throws IOException
IOException
public void addAuthInfo(String scheme,
byte[] auth)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||