public class ClientCnxn extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
xid |
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.
|
protected void |
finishPacket(org.apache.zookeeper.ClientCnxn.Packet p) |
long |
getLastZxid() |
long |
getSessionId() |
byte[] |
getSessionPasswd() |
int |
getSessionTimeout() |
int |
getXid() |
org.apache.zookeeper.ClientCnxn.Packet |
queuePacket(RequestHeader h,
ReplyHeader r,
Record request,
Record response,
AsyncCallback cb,
String clientPath,
String serverPath,
Object ctx,
ZooKeeper.WatchRegistration watchRegistration) |
org.apache.zookeeper.ClientCnxn.Packet |
queuePacket(RequestHeader h,
ReplyHeader r,
Record request,
Record response,
AsyncCallback cb,
String clientPath,
String serverPath,
Object ctx,
ZooKeeper.WatchRegistration watchRegistration,
WatchDeregistration watchDeregistration) |
void |
saslCompleted() |
void |
sendPacket(Record request,
Record response,
AsyncCallback cb,
int opCode) |
void |
start() |
ReplyHeader |
submitRequest(RequestHeader h,
Record request,
Record response,
ZooKeeper.WatchRegistration watchRegistration) |
ReplyHeader |
submitRequest(RequestHeader h,
Record request,
Record response,
ZooKeeper.WatchRegistration watchRegistration,
WatchDeregistration watchDeregistration) |
String |
toString() |
public ZooKeeperSaslClient zooKeeperSaslClient
protected int xid
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 void start()
protected void finishPacket(org.apache.zookeeper.ClientCnxn.Packet p)
public long getLastZxid()
public void disconnect()
public void close() throws IOException
IOException
public int getXid()
public ReplyHeader submitRequest(RequestHeader h, Record request, Record response, ZooKeeper.WatchRegistration watchRegistration) throws InterruptedException
InterruptedException
public ReplyHeader submitRequest(RequestHeader h, Record request, Record response, ZooKeeper.WatchRegistration watchRegistration, WatchDeregistration watchDeregistration) throws InterruptedException
InterruptedException
public void saslCompleted()
public void sendPacket(Record request, Record response, AsyncCallback cb, int opCode) throws IOException
IOException
public org.apache.zookeeper.ClientCnxn.Packet queuePacket(RequestHeader h, ReplyHeader r, Record request, Record response, AsyncCallback cb, String clientPath, String serverPath, Object ctx, ZooKeeper.WatchRegistration watchRegistration)
public org.apache.zookeeper.ClientCnxn.Packet queuePacket(RequestHeader h, ReplyHeader r, Record request, Record response, AsyncCallback cb, String clientPath, String serverPath, Object ctx, ZooKeeper.WatchRegistration watchRegistration, WatchDeregistration watchDeregistration)
public void addAuthInfo(String scheme, byte[] auth)
Copyright © 2008–2019 The Apache Software Foundation. All rights reserved.