Java 类org.apache.zookeeper.proto.GetChildrenRequest 实例源码

项目:https-github.com-apache-zookeeper    文件:ZooKeeper.java   
/**
 * The asynchronous version of getChildren.
 *
 * @see #getChildren(String, Watcher)
 */
public void getChildren(final String path, Watcher watcher,
        ChildrenCallback cb, Object ctx)
{
    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);
}
项目:bigstreams    文件:ZooKeeper.java   
/**
 * 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)
{
    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);
}
项目:zookeeper-src-learning    文件:ZooKeeper.java   
/**
 * The asynchronous version of getChildren.
 *
 * @see #getChildren(String, Watcher)
 */
public void getChildren(final String path, Watcher watcher,
        ChildrenCallback cb, Object ctx)
{
    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);
}
项目:SecureKeeper    文件:ZooKeeper.java   
/**
 * The asynchronous version of getChildren.
 *
 * @see #getChildren(String, Watcher)
 */
public void getChildren(final String path, Watcher watcher,
        ChildrenCallback cb, Object ctx)
{
    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);
}
项目:SecureKeeper    文件:ZooKeeper.java   
/**
 * The asynchronous version of getChildren.
 *
 * @see #getChildren(String, Watcher)
 */
public void getChildren(final String path, Watcher watcher,
        ChildrenCallback cb, Object ctx)
{
    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);
}
项目:zookeeper.dsc    文件:ZooKeeper.java   
/**
 * 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)
{
    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);
}
项目:https-github.com-apache-zookeeper    文件:ZooKeeper.java   
/**
 * Return the list of the children of the node of the given path.
 * <p>
 * If the watch is non-null and the call is successful (no exception is thrown),
 * a watch will be left on the node with the given path. The watch willbe
 * triggered by a successful operation that deletes the node of the given
 * path or creates/delete a child under the node.
 * <p>
 * The list of children returned is not sorted and no guarantee is provided
 * as to its natural or lexical order.
 * <p>
 * A KeeperException with error code KeeperException.NoNode will be thrown
 * if no node with the given path exists.
 *
 * @param path
 * @param watcher explicit watcher
 * @return an unordered array of children of the node with the given path
 * @throws InterruptedException If the server transaction is interrupted.
 * @throws KeeperException If the server signals an error with a non-zero error code.
 * @throws IllegalArgumentException if an invalid path is specified
 */
public List<String> getChildren(final String path, Watcher watcher)
    throws KeeperException, InterruptedException
{
    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();
    ReplyHeader r = cnxn.submitRequest(h, request, response, wcb);
    if (r.getErr() != 0) {
        throw KeeperException.create(KeeperException.Code.get(r.getErr()),
                clientPath);
    }
    return response.getChildren();
}
项目:bigstreams    文件:ZooKeeper.java   
/**
 * Return the list of the children of the node of the given path.
 * <p>
 * If the watch is non-null and the call is successful (no exception is thrown),
 * a watch will be left on the node with the given path. The watch willbe
 * triggered by a successful operation that deletes the node of the given
 * path or creates/delete a child under the node.
 * <p>
 * The list of children returned is not sorted and no guarantee is provided
 * as to its natural or lexical order.
 * <p>
 * A KeeperException with error code KeeperException.NoNode will be thrown
 * if no node with the given path exists.
 *
 * @param path
 * @param watcher explicit watcher
 * @return an unordered array of children of the node with the given path
 * @throws InterruptedException If the server transaction is interrupted.
 * @throws KeeperException If the server signals an error with a non-zero error code.
 * @throws IllegalArgumentException if an invalid path is specified
 */
public List<String> getChildren(final String path, Watcher watcher)
    throws KeeperException, InterruptedException
{
    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();
    ReplyHeader r = cnxn.submitRequest(h, request, response, wcb);
    if (r.getErr() != 0) {
        throw KeeperException.create(KeeperException.Code.get(r.getErr()),
                clientPath);
    }
    return response.getChildren();
}
项目:zookeeper-src-learning    文件:ZooKeeper.java   
/**
 * Return the list of the children of the node of the given path.
 * <p>
 * If the watch is non-null and the call is successful (no exception is thrown),
 * a watch will be left on the node with the given path. The watch willbe
 * triggered by a successful operation that deletes the node of the given
 * path or creates/delete a child under the node.
 * <p>
 * The list of children returned is not sorted and no guarantee is provided
 * as to its natural or lexical order.
 * <p>
 * A KeeperException with error code KeeperException.NoNode will be thrown
 * if no node with the given path exists.
 *
 * @param path
 * @param watcher explicit watcher
 * @return an unordered array of children of the node with the given path
 * @throws InterruptedException If the server transaction is interrupted.
 * @throws KeeperException If the server signals an error with a non-zero error code.
 * @throws IllegalArgumentException if an invalid path is specified
 */
public List<String> getChildren(final String path, Watcher watcher)
    throws KeeperException, InterruptedException
{
    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();
    ReplyHeader r = cnxn.submitRequest(h, request, response, wcb);
    if (r.getErr() != 0) {
        throw KeeperException.create(KeeperException.Code.get(r.getErr()),
                clientPath);
    }
    return response.getChildren();
}
项目:incubator-pulsar    文件:ClientCnxnAspect.java   
private EventType checkType(Record response) {

        if (response == null) {
            return EventType.other;
        } else if (response instanceof ConnectRequest) {
            return EventType.write;
        } else if (response instanceof CreateRequest) {
            return EventType.write;
        } else if (response instanceof DeleteRequest) {
            return EventType.write;
        } else if (response instanceof SetDataRequest) {
            return EventType.write;
        } else if (response instanceof SetACLRequest) {
            return EventType.write;
        } else if (response instanceof SetMaxChildrenRequest) {
            return EventType.write;
        } else if (response instanceof SetSASLRequest) {
            return EventType.write;
        } else if (response instanceof SetWatches) {
            return EventType.write;
        } else if (response instanceof SyncRequest) {
            return EventType.write;
        } else if (response instanceof ExistsRequest) {
            return EventType.read;
        } else if (response instanceof GetDataRequest) {
            return EventType.read;
        } else if (response instanceof GetMaxChildrenRequest) {
            return EventType.read;
        } else if (response instanceof GetACLRequest) {
            return EventType.read;
        } else if (response instanceof GetChildrenRequest) {
            return EventType.read;
        } else if (response instanceof GetChildren2Request) {
            return EventType.read;
        } else if (response instanceof GetSASLRequest) {
            return EventType.read;
        } else {
            return EventType.other;
        }
    }
项目:SecureKeeper    文件:ZooKeeper.java   
/**
 * Return the list of the children of the node of the given path.
 * <p>
 * If the watch is non-null and the call is successful (no exception is thrown),
 * a watch will be left on the node with the given path. The watch willbe
 * triggered by a successful operation that deletes the node of the given
 * path or creates/delete a child under the node.
 * <p>
 * The list of children returned is not sorted and no guarantee is provided
 * as to its natural or lexical order.
 * <p>
 * A KeeperException with error code KeeperException.NoNode will be thrown
 * if no node with the given path exists.
 *
 * @param path
 * @param watcher explicit watcher
 * @return an unordered array of children of the node with the given path
 * @throws InterruptedException If the server transaction is interrupted.
 * @throws KeeperException If the server signals an error with a non-zero error code.
 * @throws IllegalArgumentException if an invalid path is specified
 */
public List<String> getChildren(final String path, Watcher watcher)
    throws KeeperException, InterruptedException
{
    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();
    ReplyHeader r = cnxn.submitRequest(h, request, response, wcb);
    if (r.getErr() != 0) {
        throw KeeperException.create(KeeperException.Code.get(r.getErr()),
                clientPath);
    }
    return response.getChildren();
}
项目:SecureKeeper    文件:ZooKeeper.java   
/**
 * Return the list of the children of the node of the given path.
 * <p>
 * If the watch is non-null and the call is successful (no exception is thrown),
 * a watch will be left on the node with the given path. The watch willbe
 * triggered by a successful operation that deletes the node of the given
 * path or creates/delete a child under the node.
 * <p>
 * The list of children returned is not sorted and no guarantee is provided
 * as to its natural or lexical order.
 * <p>
 * A KeeperException with error code KeeperException.NoNode will be thrown
 * if no node with the given path exists.
 *
 * @param path
 * @param watcher explicit watcher
 * @return an unordered array of children of the node with the given path
 * @throws InterruptedException If the server transaction is interrupted.
 * @throws KeeperException If the server signals an error with a non-zero error code.
 * @throws IllegalArgumentException if an invalid path is specified
 */
public List<String> getChildren(final String path, Watcher watcher)
    throws KeeperException, InterruptedException
{
    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();
    ReplyHeader r = cnxn.submitRequest(h, request, response, wcb);
    if (r.getErr() != 0) {
        throw KeeperException.create(KeeperException.Code.get(r.getErr()),
                clientPath);
    }
    return response.getChildren();
}
项目:zookeeper.dsc    文件:ZooKeeper.java   
/**
 * Return the list of the children of the node of the given path.
 * <p>
 * If the watch is non-null and the call is successful (no exception is thrown),
 * a watch will be left on the node with the given path. The watch willbe
 * triggered by a successful operation that deletes the node of the given
 * path or creates/delete a child under the node.
 * <p>
 * The list of children returned is not sorted and no guarantee is provided
 * as to its natural or lexical order.
 * <p>
 * A KeeperException with error code KeeperException.NoNode will be thrown
 * if no node with the given path exists.
 *
 * @param path
 * @param watcher explicit watcher
 * @return an unordered array of children of the node with the given path
 * @throws InterruptedException If the server transaction is interrupted.
 * @throws KeeperException If the server signals an error with a non-zero error code.
 * @throws IllegalArgumentException if an invalid path is specified
 */
public List<String> getChildren(final String path, Watcher watcher)
    throws KeeperException, InterruptedException
{
    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();
    ReplyHeader r = cnxn.submitRequest(h, request, response, wcb);
    if (r.getErr() != 0) {
        throw KeeperException.create(KeeperException.Code.get(r.getErr()),
                clientPath);
    }
    return response.getChildren();
}
项目:zookeeper-lite    文件:IGetChildrenRequest.java   
public IGetChildrenRequest() {
    this(new GetChildrenRequest());
}
项目:zookeeper-lite    文件:IGetChildrenRequest.java   
public IGetChildrenRequest(String path, boolean watch) {
    this(new GetChildrenRequest(path, watch));
}
项目:zookeeper-lite    文件:IGetChildrenRequest.java   
public IGetChildrenRequest(GetChildrenRequest record) {
    super(record);
}