Package org.apache.zookeeper.Watcher

Examples of org.apache.zookeeper.Watcher.WatcherType


    }

    @Override
    public boolean exec() throws KeeperException, InterruptedException {
        String path = args[1];
        WatcherType wtype = WatcherType.Any;
        // if no matching option -c or -d or -a is specified, we remove
        // the watches of the given node by choosing WatcherType.Any
        if (cl.hasOption("c")) {
            wtype = WatcherType.Children;
        } else if (cl.hasOption("d")) {
View Full Code Here


            case OpCode.checkWatches: {
                lastOp = "CHKW";
                CheckWatchesRequest checkWatches = new CheckWatchesRequest();
                ByteBufferInputStream.byteBuffer2Record(request.request,
                        checkWatches);
                WatcherType type = WatcherType.fromInt(checkWatches.getType());
                boolean containsWatcher = zks.getZKDatabase().containsWatcher(
                        checkWatches.getPath(), type, cnxn);
                if (!containsWatcher) {
                    String msg = String.format(Locale.ENGLISH, "%s (type: %s)",
                            new Object[] { checkWatches.getPath(), type });
                    throw new KeeperException.NoWatcherException(msg);
                }
                break;
            }
            case OpCode.removeWatches: {
                lastOp = "REMW";
                RemoveWatchesRequest removeWatches = new RemoveWatchesRequest();
                ByteBufferInputStream.byteBuffer2Record(request.request,
                        removeWatches);
                WatcherType type = WatcherType.fromInt(removeWatches.getType());
                boolean removed = zks.getZKDatabase().removeWatch(
                        removeWatches.getPath(), type, cnxn);
                if (!removed) {
                    String msg = String.format(Locale.ENGLISH, "%s (type: %s)",
                            new Object[] { removeWatches.getPath(), type });
View Full Code Here

TOP

Related Classes of org.apache.zookeeper.Watcher.WatcherType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.