Examples of SetDataResponse


Examples of org.apache.zookeeper.proto.SetDataResponse

        RequestHeader h = new RequestHeader();
        h.setType(ZooDefs.OpCode.exists);
        ExistsRequest request = new ExistsRequest();
        request.setPath(path);
        request.setWatch(watcher != null);
        SetDataResponse response = new SetDataResponse();
        WatchRegistration wcb = null;
        if (watcher != null) {
            wcb = new ExistsWatchRegistration(watcher, path);
        }
        ReplyHeader r = cnxn.submitRequest(h, request, response, wcb);
        if (r.getErr() != 0) {
            if (r.getErr() == KeeperException.Code.NoNode) {
                return null;
            }
            throw KeeperException.create(r.getErr());
        }

        return response.getStat().getCzxid() == -1 ? null : response.getStat();
    }
View Full Code Here

Examples of org.apache.zookeeper.proto.SetDataResponse

        RequestHeader h = new RequestHeader();
        h.setType(ZooDefs.OpCode.exists);
        ExistsRequest request = new ExistsRequest();
        request.setPath(path);
        request.setWatch(watcher != null);
        SetDataResponse response = new SetDataResponse();
        WatchRegistration wcb = null;
        if (watcher != null) {
            wcb = new ExistsWatchRegistration(watcher, path);
        }
        cnxn.queuePacket(h, new ReplyHeader(), request, response, cb, path,
View Full Code Here

Examples of org.apache.zookeeper.proto.SetDataResponse

        h.setType(ZooDefs.OpCode.setData);
        SetDataRequest request = new SetDataRequest();
        request.setPath(path);
        request.setData(data);
        request.setVersion(version);
        SetDataResponse response = new SetDataResponse();
        ReplyHeader r = cnxn.submitRequest(h, request, response, null);
        if (r.getErr() != 0) {
            throw KeeperException.create(r.getErr());
        }
        return response.getStat();
    }
View Full Code Here

Examples of org.apache.zookeeper.proto.SetDataResponse

        h.setType(ZooDefs.OpCode.setData);
        SetDataRequest request = new SetDataRequest();
        request.setPath(path);
        request.setData(data);
        request.setVersion(version);
        SetDataResponse response = new SetDataResponse();
        cnxn
                .queuePacket(h, new ReplyHeader(), request, response, cb, path,
                        ctx, null);
    }
View Full Code Here

Examples of org.apache.zookeeper.proto.SetDataResponse

                break;
            case OpCode.delete:
                err = Code.get(rc.err);
                break;
            case OpCode.setData:
                rsp = new SetDataResponse(rc.stat);
                err = Code.get(rc.err);
                break;
            case OpCode.setACL:
                rsp = new SetACLResponse(rc.stat);
                err = Code.get(rc.err);
View Full Code Here

Examples of org.apache.zookeeper.proto.SetDataResponse

        RequestHeader h = new RequestHeader();
        h.setType(ZooDefs.OpCode.exists);
        ExistsRequest request = new ExistsRequest();
        request.setPath(path);
        request.setWatch(watcher != null);
        SetDataResponse response = new SetDataResponse();
        WatchRegistration wcb = null;
        if (watcher != null) {
            wcb = new ExistsWatchRegistration(watcher, path);
        }
        ReplyHeader r = cnxn.submitRequest(h, request, response, wcb);
        if (r.getErr() != 0) {
            if (r.getErr() == KeeperException.Code.NONODE.intValue()) {
                return null;
            }
            throw KeeperException.create(KeeperException.Code.get(r.getErr()),
                    path);
        }

        return response.getStat().getCzxid() == -1 ? null : response.getStat();
    }
View Full Code Here

Examples of org.apache.zookeeper.proto.SetDataResponse

        RequestHeader h = new RequestHeader();
        h.setType(ZooDefs.OpCode.exists);
        ExistsRequest request = new ExistsRequest();
        request.setPath(path);
        request.setWatch(watcher != null);
        SetDataResponse response = new SetDataResponse();
        WatchRegistration wcb = null;
        if (watcher != null) {
            wcb = new ExistsWatchRegistration(watcher, path);
        }
        cnxn.queuePacket(h, new ReplyHeader(), request, response, cb, path,
View Full Code Here

Examples of org.apache.zookeeper.proto.SetDataResponse

        h.setType(ZooDefs.OpCode.setData);
        SetDataRequest request = new SetDataRequest();
        request.setPath(path);
        request.setData(data);
        request.setVersion(version);
        SetDataResponse response = new SetDataResponse();
        ReplyHeader r = cnxn.submitRequest(h, request, response, null);
        if (r.getErr() != 0) {
            throw KeeperException.create(KeeperException.Code.get(r.getErr()),
                    path);
        }
        return response.getStat();
    }
View Full Code Here

Examples of org.apache.zookeeper.proto.SetDataResponse

        h.setType(ZooDefs.OpCode.setData);
        SetDataRequest request = new SetDataRequest();
        request.setPath(path);
        request.setData(data);
        request.setVersion(version);
        SetDataResponse response = new SetDataResponse();
        cnxn
                .queuePacket(h, new ReplyHeader(), request, response, cb, path,
                        ctx, null);
    }
View Full Code Here

Examples of org.apache.zookeeper.proto.SetDataResponse

                err = Code.get(rc.err);
                break;
            }
            case OpCode.setData: {
                lastOp = "SETD";
                rsp = new SetDataResponse(rc.stat);
                err = Code.get(rc.err);
                break;
            }
            case OpCode.setACL: {
                lastOp = "SETA";
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.