Package org.apache.zookeeper.proto

Examples of org.apache.zookeeper.proto.CreateRequest.serialize()


            boa.writeInt(52, "len"); // We'll fill this in later
            RequestHeader header = new RequestHeader(2, OpCode.create);
            header.serialize(boa, "header");
            CreateRequest createReq = new CreateRequest("/foo" + i, new byte[0],
                    Ids.OPEN_ACL_UNSAFE, 1);
            createReq.serialize(boa, "request");
            baos.close();
           
            System.out.println("Length:" + baos.toByteArray().length);
           
            String hp[] = hostPort.split(":");
View Full Code Here


            boa.writeInt(52, "len"); // We'll fill this in later
            RequestHeader header = new RequestHeader(2, OpCode.create);
            header.serialize(boa, "header");
            CreateRequest createReq = new CreateRequest("/foo" + i, new byte[0],
                    Ids.OPEN_ACL_UNSAFE, 1);
            createReq.serialize(boa, "request");
            baos.close();
           
            System.out.println("Length:" + baos.toByteArray().length);
           
            String hp[] = hostPort.split(":");
View Full Code Here

        CreateRequest createRequest = new CreateRequest("/impossible",
                new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL.toFlag());
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        BinaryOutputArchive boa = BinaryOutputArchive.getArchive(baos);
        createRequest.serialize(boa, "request");
        ByteBuffer bb = ByteBuffer.wrap(baos.toByteArray());

        // Mimic sessionId generated by follower's local session tracker
        long sid = qu.getFollowerQuorumPeers().get(0).getActiveServer()
                .getServerId();
View Full Code Here

        CreateRequest createRequest = new CreateRequest("/success",
                new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT.toFlag());
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        BinaryOutputArchive boa = BinaryOutputArchive.getArchive(baos);
        createRequest.serialize(boa, "request");
        ByteBuffer bb = ByteBuffer.wrap(baos.toByteArray());

        // Mimic sessionId generated by follower's local session tracker
        long sid = qu.getFollowerQuorumPeers().get(0).getActiveServer()
                .getServerId();
View Full Code Here

            ByteArrayOutputStream boas = new ByteArrayOutputStream();
            BinaryOutputArchive boa = BinaryOutputArchive.getArchive(boas);
            CreateRequest createReq = new CreateRequest(
                "/session" + Long.toHexString(sessionId) + "-" + (++nodeId),
                new byte[0], Ids.OPEN_ACL_UNSAFE, 1);
            createReq.serialize(boa, "request");
            ByteBuffer bb = ByteBuffer.wrap(boas.toByteArray());
            Request req = new Request(null, sessionId, ++cxid, OpCode.create,
                                      bb, new ArrayList<Id>());
            zks.firstProcessor.processRequest(req);
        }
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.