use of org.apache.zookeeper_voltpatches.proto.RequestHeader in project voltdb by VoltDB.
the class ClientCnxn method close.
/**
* Close the connection, which includes; send session disconnect to the
* server, shutdown the send/event threads.
*
* @throws IOException
*/
public void close() throws IOException {
if (LOG.isDebugEnabled()) {
LOG.debug("Closing client for session: 0x" + Long.toHexString(getSessionId()));
}
try {
RequestHeader h = new RequestHeader();
h.setType(ZooDefs.OpCode.closeSession);
submitRequest(h, null, null, null);
} catch (InterruptedException e) {
// ignore, close the send/event threads
} finally {
disconnect();
}
}
use of org.apache.zookeeper_voltpatches.proto.RequestHeader in project voltdb by VoltDB.
the class ZooKeeper method getChildren.
/**
* The Asynchronous version of getChildren. The request doesn't actually
* until the asynchronous callback is called.
*
* @see #getChildren(String, Watcher)
*/
public void getChildren(final String path, Watcher watcher, ChildrenCallback cb, Object ctx) {
verbotenThreadCheck();
final String clientPath = path;
PathUtils.validatePath(clientPath);
// the watch contains the un-chroot path
WatchRegistration wcb = null;
if (watcher != null) {
wcb = new ChildWatchRegistration(watcher, clientPath);
}
final String serverPath = prependChroot(clientPath);
RequestHeader h = new RequestHeader();
h.setType(ZooDefs.OpCode.getChildren);
GetChildrenRequest request = new GetChildrenRequest();
request.setPath(serverPath);
request.setWatch(watcher != null);
GetChildrenResponse response = new GetChildrenResponse();
cnxn.queuePacket(h, new ReplyHeader(), request, response, cb, clientPath, serverPath, ctx, wcb);
}
use of org.apache.zookeeper_voltpatches.proto.RequestHeader in project voltdb by VoltDB.
the class ZooKeeper method setACL.
/**
* The Asynchronous version of setACL. The request doesn't actually until
* the asynchronous callback is called.
*
* @see #setACL(String, List, int)
*/
public void setACL(final String path, List<ACL> acl, int version, StatCallback cb, Object ctx) {
verbotenThreadCheck();
final String clientPath = path;
PathUtils.validatePath(clientPath);
final String serverPath = prependChroot(clientPath);
RequestHeader h = new RequestHeader();
h.setType(ZooDefs.OpCode.setACL);
SetACLRequest request = new SetACLRequest();
request.setPath(serverPath);
request.setAcl(acl);
request.setVersion(version);
SetACLResponse response = new SetACLResponse();
cnxn.queuePacket(h, new ReplyHeader(), request, response, cb, clientPath, serverPath, ctx, null);
}
use of org.apache.zookeeper_voltpatches.proto.RequestHeader in project voltdb by VoltDB.
the class ZooKeeper method exists.
/**
* The Asynchronous version of exists. The request doesn't actually until
* the asynchronous callback is called.
*
* @see #exists(String, boolean)
*/
public void exists(final String path, Watcher watcher, StatCallback cb, Object ctx) {
verbotenThreadCheck();
final String clientPath = path;
PathUtils.validatePath(clientPath);
// the watch contains the un-chroot path
WatchRegistration wcb = null;
if (watcher != null) {
wcb = new ExistsWatchRegistration(watcher, clientPath);
}
final String serverPath = prependChroot(clientPath);
RequestHeader h = new RequestHeader();
h.setType(ZooDefs.OpCode.exists);
ExistsRequest request = new ExistsRequest();
request.setPath(serverPath);
request.setWatch(watcher != null);
SetDataResponse response = new SetDataResponse();
cnxn.queuePacket(h, new ReplyHeader(), request, response, cb, clientPath, serverPath, ctx, wcb);
}
use of org.apache.zookeeper_voltpatches.proto.RequestHeader in project voltdb by VoltDB.
the class ZooKeeper method getACL.
/**
* The Asynchronous version of getACL. The request doesn't actually until
* the asynchronous callback is called.
*
* @see #getACL(String, Stat)
*/
public void getACL(final String path, Stat stat, ACLCallback cb, Object ctx) {
verbotenThreadCheck();
final String clientPath = path;
PathUtils.validatePath(clientPath);
final String serverPath = prependChroot(clientPath);
RequestHeader h = new RequestHeader();
h.setType(ZooDefs.OpCode.getACL);
GetACLRequest request = new GetACLRequest();
request.setPath(serverPath);
GetACLResponse response = new GetACLResponse();
cnxn.queuePacket(h, new ReplyHeader(), request, response, cb, clientPath, serverPath, ctx, null);
}
Aggregations