public class ClientCnxn
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
static int |
packetLen |
|
ZooKeeperSaslClient |
zooKeeperSaslClient |
| Constructor | Description |
|---|---|
ClientCnxn(java.lang.String chrootPath,
HostProvider hostProvider,
int sessionTimeout,
ZooKeeper zooKeeper,
ClientWatchManager watcher,
org.apache.zookeeper.ClientCnxnSocket clientCnxnSocket,
boolean canBeReadOnly) |
Creates a connection object.
|
ClientCnxn(java.lang.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.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addAuthInfo(java.lang.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(Record request,
Record response,
AsyncCallback cb,
int opCode) |
|
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) |
|
java.lang.String |
toString() |
public ZooKeeperSaslClient zooKeeperSaslClient
public static final int packetLen
public ClientCnxn(java.lang.String chrootPath,
HostProvider hostProvider,
int sessionTimeout,
ZooKeeper zooKeeper,
ClientWatchManager watcher,
org.apache.zookeeper.ClientCnxnSocket clientCnxnSocket,
boolean canBeReadOnly)
throws java.io.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 partitioningjava.io.IOExceptionpublic ClientCnxn(java.lang.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 partitioningjava.io.IOExceptionpublic long getSessionId()
public byte[] getSessionPasswd()
public int getSessionTimeout()
public java.lang.String toString()
toString in class java.lang.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 java.io.IOException
java.io.IOExceptionpublic int getXid()
public org.apache.zookeeper.proto.ReplyHeader submitRequest(org.apache.zookeeper.proto.RequestHeader h,
Record request,
Record response,
org.apache.zookeeper.ZooKeeper.WatchRegistration watchRegistration)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void enableWrite()
public void sendPacket(Record request, Record response, AsyncCallback cb, int opCode) throws java.io.IOException
java.io.IOExceptionpublic void addAuthInfo(java.lang.String scheme,
byte[] auth)
Copyright © 2018 The Apache Software Foundation