public class ClientCnxn extends Object
Modifier and Type | Field and Description |
---|---|
static int |
packetLen |
ZooKeeperSaslClient |
zooKeeperSaslClient |
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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() |
public ZooKeeperSaslClient zooKeeperSaslClient
public static final int packetLen
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 partitioningIOException
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 partitioningIOException
public long getSessionId()
public byte[] getSessionPasswd()
public int getSessionTimeout()
public 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
IOException
public 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
InterruptedException
public 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)
Copyright © 2016 The Apache Software Foundation