Search in sources :

Example 16 with ReplyHeader

use of org.apache.zookeeper_voltpatches.proto.ReplyHeader 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);
}
Also used : GetChildrenRequest(org.apache.zookeeper_voltpatches.proto.GetChildrenRequest) ReplyHeader(org.apache.zookeeper_voltpatches.proto.ReplyHeader) GetChildrenResponse(org.apache.zookeeper_voltpatches.proto.GetChildrenResponse) RequestHeader(org.apache.zookeeper_voltpatches.proto.RequestHeader)

Example 17 with ReplyHeader

use of org.apache.zookeeper_voltpatches.proto.ReplyHeader 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);
}
Also used : ReplyHeader(org.apache.zookeeper_voltpatches.proto.ReplyHeader) SetACLRequest(org.apache.zookeeper_voltpatches.proto.SetACLRequest) RequestHeader(org.apache.zookeeper_voltpatches.proto.RequestHeader) SetACLResponse(org.apache.zookeeper_voltpatches.proto.SetACLResponse)

Example 18 with ReplyHeader

use of org.apache.zookeeper_voltpatches.proto.ReplyHeader 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);
}
Also used : ExistsRequest(org.apache.zookeeper_voltpatches.proto.ExistsRequest) ReplyHeader(org.apache.zookeeper_voltpatches.proto.ReplyHeader) RequestHeader(org.apache.zookeeper_voltpatches.proto.RequestHeader) SetDataResponse(org.apache.zookeeper_voltpatches.proto.SetDataResponse)

Example 19 with ReplyHeader

use of org.apache.zookeeper_voltpatches.proto.ReplyHeader 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);
}
Also used : ReplyHeader(org.apache.zookeeper_voltpatches.proto.ReplyHeader) GetACLRequest(org.apache.zookeeper_voltpatches.proto.GetACLRequest) RequestHeader(org.apache.zookeeper_voltpatches.proto.RequestHeader) GetACLResponse(org.apache.zookeeper_voltpatches.proto.GetACLResponse)

Example 20 with ReplyHeader

use of org.apache.zookeeper_voltpatches.proto.ReplyHeader in project voltdb by VoltDB.

the class ZooKeeper method setData.

/**
     * The Asynchronous version of setData. The request doesn't actually until
     * the asynchronous callback is called.
     *
     * @see #setData(String, byte[], int)
     */
public void setData(final String path, byte[] data, 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.setData);
    SetDataRequest request = new SetDataRequest();
    request.setPath(serverPath);
    request.setData(data);
    request.setVersion(version);
    SetDataResponse response = new SetDataResponse();
    cnxn.queuePacket(h, new ReplyHeader(), request, response, cb, clientPath, serverPath, ctx, null);
}
Also used : ReplyHeader(org.apache.zookeeper_voltpatches.proto.ReplyHeader) RequestHeader(org.apache.zookeeper_voltpatches.proto.RequestHeader) SetDataRequest(org.apache.zookeeper_voltpatches.proto.SetDataRequest) SetDataResponse(org.apache.zookeeper_voltpatches.proto.SetDataResponse)

Aggregations

ReplyHeader (org.apache.zookeeper_voltpatches.proto.ReplyHeader)25 RequestHeader (org.apache.zookeeper_voltpatches.proto.RequestHeader)20 SetDataResponse (org.apache.zookeeper_voltpatches.proto.SetDataResponse)5 CreateResponse (org.apache.zookeeper_voltpatches.proto.CreateResponse)3 ExistsRequest (org.apache.zookeeper_voltpatches.proto.ExistsRequest)3 GetACLRequest (org.apache.zookeeper_voltpatches.proto.GetACLRequest)3 GetACLResponse (org.apache.zookeeper_voltpatches.proto.GetACLResponse)3 GetChildren2Request (org.apache.zookeeper_voltpatches.proto.GetChildren2Request)3 GetChildren2Response (org.apache.zookeeper_voltpatches.proto.GetChildren2Response)3 GetChildrenRequest (org.apache.zookeeper_voltpatches.proto.GetChildrenRequest)3 GetChildrenResponse (org.apache.zookeeper_voltpatches.proto.GetChildrenResponse)3 GetDataRequest (org.apache.zookeeper_voltpatches.proto.GetDataRequest)3 GetDataResponse (org.apache.zookeeper_voltpatches.proto.GetDataResponse)3 SetACLResponse (org.apache.zookeeper_voltpatches.proto.SetACLResponse)3 AuthPacket (org.apache.zookeeper_voltpatches.proto.AuthPacket)2 CreateRequest (org.apache.zookeeper_voltpatches.proto.CreateRequest)2 DeleteRequest (org.apache.zookeeper_voltpatches.proto.DeleteRequest)2 SetACLRequest (org.apache.zookeeper_voltpatches.proto.SetACLRequest)2 SetDataRequest (org.apache.zookeeper_voltpatches.proto.SetDataRequest)2 SyncRequest (org.apache.zookeeper_voltpatches.proto.SyncRequest)2