Java 类org.apache.zookeeper.MockPacket 实例源码

项目:fuck_zookeeper    文件:WatchLeakTest.java   
/**
 * Create a watches message with a single watch on /
 * 
 * @return
 */
private ByteBuffer createWatchesMessage() {
    List<String> dataWatches = new ArrayList<String>(1);
    dataWatches.add("/");
    List<String> existWatches = Collections.emptyList();
    List<String> childWatches = Collections.emptyList();
    SetWatches sw = new SetWatches(1L, dataWatches, existWatches,
            childWatches);
    RequestHeader h = new RequestHeader();
    h.setType(ZooDefs.OpCode.setWatches);
    h.setXid(-8);
    MockPacket p = new MockPacket(h, new ReplyHeader(), sw, null, null);
    return p.createAndReturnBB();
}
项目:fuck_zookeeper    文件:WatchLeakTest.java   
/**
 * Create a connection request
 * 
 * @return
 */
private ByteBuffer createConnRequest() {
    Random r = new Random(SESSION_ID ^ superSecret);
    byte p[] = new byte[16];
    r.nextBytes(p);
    ConnectRequest conReq = new ConnectRequest(0, 1L, 30000, SESSION_ID, p);
    MockPacket packet = new MockPacket(null, null, conReq, null, null, false);
    return packet.createAndReturnBB();
}
项目:https-github.com-apache-zookeeper    文件:WatchLeakTest.java   
/**
 * Create a watches message with a single watch on /
 *
 * @return a message that attempts to set 1 watch on /
 */
private ByteBuffer createWatchesMessage() {
    List<String> dataWatches = new ArrayList<String>(1);
    dataWatches.add("/");
    List<String> existWatches = Collections.emptyList();
    List<String> childWatches = Collections.emptyList();
    SetWatches sw = new SetWatches(1L, dataWatches, existWatches,
            childWatches);
    RequestHeader h = new RequestHeader();
    h.setType(ZooDefs.OpCode.setWatches);
    h.setXid(-8);
    MockPacket p = new MockPacket(h, new ReplyHeader(), sw, null, null);
    return p.createAndReturnBB();
}
项目:https-github.com-apache-zookeeper    文件:WatchLeakTest.java   
/**
 * Create a connection request
 *
 * @return a serialized connection request
 */
private ByteBuffer createConnRequest() {
    Random r = new Random(SESSION_ID ^ superSecret);
    byte p[] = new byte[16];
    r.nextBytes(p);
    ConnectRequest conReq = new ConnectRequest(0, 1L, 30000, SESSION_ID, p);
    MockPacket packet = new MockPacket(null, null, conReq, null, null, false);
    return packet.createAndReturnBB();
}
项目:ZooKeeper    文件:WatchLeakTest.java   
/**
 * Create a watches message with a single watch on /
 * 
 * @return
 */
private ByteBuffer createWatchesMessage() {
    List<String> dataWatches = new ArrayList<String>(1);
    dataWatches.add("/");
    List<String> existWatches = Collections.emptyList();
    List<String> childWatches = Collections.emptyList();
    SetWatches sw = new SetWatches(1L, dataWatches, existWatches,
            childWatches);
    RequestHeader h = new RequestHeader();
    h.setType(ZooDefs.OpCode.setWatches);
    h.setXid(-8);
    MockPacket p = new MockPacket(h, new ReplyHeader(), sw, null, null);
    return p.createAndReturnBB();
}
项目:ZooKeeper    文件:WatchLeakTest.java   
/**
 * Create a connection request
 * 
 * @return
 */
private ByteBuffer createConnRequest() {
    Random r = new Random(SESSION_ID ^ superSecret);
    byte p[] = new byte[16];
    r.nextBytes(p);
    ConnectRequest conReq = new ConnectRequest(0, 1L, 30000, SESSION_ID, p);
    MockPacket packet = new MockPacket(null, null, conReq, null, null, false);
    return packet.createAndReturnBB();
}
项目:StreamProcessingInfrastructure    文件:WatchLeakTest.java   
/**
 * Create a watches message with a single watch on /
 * 
 * @return
 */
private ByteBuffer createWatchesMessage() {
    List<String> dataWatches = new ArrayList<String>(1);
    dataWatches.add("/");
    List<String> existWatches = Collections.emptyList();
    List<String> childWatches = Collections.emptyList();
    SetWatches sw = new SetWatches(1L, dataWatches, existWatches,
            childWatches);
    RequestHeader h = new RequestHeader();
    h.setType(ZooDefs.OpCode.setWatches);
    h.setXid(-8);
    MockPacket p = new MockPacket(h, new ReplyHeader(), sw, null, null);
    return p.createAndReturnBB();
}
项目:StreamProcessingInfrastructure    文件:WatchLeakTest.java   
/**
 * Create a connection request
 * 
 * @return
 */
private ByteBuffer createConnRequest() {
    Random r = new Random(SESSION_ID ^ superSecret);
    byte p[] = new byte[16];
    r.nextBytes(p);
    ConnectRequest conReq = new ConnectRequest(0, 1L, 30000, SESSION_ID, p);
    MockPacket packet = new MockPacket(null, null, conReq, null, null, false);
    return packet.createAndReturnBB();
}
项目:zookeeper    文件:WatchLeakTest.java   
/**
 * Create a watches message with a single watch on /
 * 
 * @return
 */
private ByteBuffer createWatchesMessage() {
    List<String> dataWatches = new ArrayList<String>(1);
    dataWatches.add("/");
    List<String> existWatches = Collections.emptyList();
    List<String> childWatches = Collections.emptyList();
    SetWatches sw = new SetWatches(1L, dataWatches, existWatches,
            childWatches);
    RequestHeader h = new RequestHeader();
    h.setType(ZooDefs.OpCode.setWatches);
    h.setXid(-8);
    MockPacket p = new MockPacket(h, new ReplyHeader(), sw, null, null);
    return p.createAndReturnBB();
}
项目:zookeeper    文件:WatchLeakTest.java   
/**
 * Create a connection request
 * 
 * @return
 */
private ByteBuffer createConnRequest() {
    Random r = new Random(SESSION_ID ^ superSecret);
    byte p[] = new byte[16];
    r.nextBytes(p);
    ConnectRequest conReq = new ConnectRequest(0, 1L, 30000, SESSION_ID, p);
    MockPacket packet = new MockPacket(null, null, conReq, null, null, false);
    return packet.createAndReturnBB();
}
项目:SecureKeeper    文件:WatchLeakTest.java   
/**
 * Create a watches message with a single watch on /
 *
 * @return a message that attempts to set 1 watch on /
 */
private ByteBuffer createWatchesMessage() {
    List<String> dataWatches = new ArrayList<String>(1);
    dataWatches.add("/");
    List<String> existWatches = Collections.emptyList();
    List<String> childWatches = Collections.emptyList();
    SetWatches sw = new SetWatches(1L, dataWatches, existWatches,
            childWatches);
    RequestHeader h = new RequestHeader();
    h.setType(ZooDefs.OpCode.setWatches);
    h.setXid(-8);
    MockPacket p = new MockPacket(h, new ReplyHeader(), sw, null, null);
    return p.createAndReturnBB();
}
项目:SecureKeeper    文件:WatchLeakTest.java   
/**
 * Create a connection request
 *
 * @return a serialized connection request
 */
private ByteBuffer createConnRequest() {
    Random r = new Random(SESSION_ID ^ superSecret);
    byte p[] = new byte[16];
    r.nextBytes(p);
    ConnectRequest conReq = new ConnectRequest(0, 1L, 30000, SESSION_ID, p);
    MockPacket packet = new MockPacket(null, null, conReq, null, null, false);
    return packet.createAndReturnBB();
}
项目:SecureKeeper    文件:WatchLeakTest.java   
/**
 * Create a watches message with a single watch on /
 *
 * @return a message that attempts to set 1 watch on /
 */
private ByteBuffer createWatchesMessage() {
    List<String> dataWatches = new ArrayList<String>(1);
    dataWatches.add("/");
    List<String> existWatches = Collections.emptyList();
    List<String> childWatches = Collections.emptyList();
    SetWatches sw = new SetWatches(1L, dataWatches, existWatches,
            childWatches);
    RequestHeader h = new RequestHeader();
    h.setType(ZooDefs.OpCode.setWatches);
    h.setXid(-8);
    MockPacket p = new MockPacket(h, new ReplyHeader(), sw, null, null);
    return p.createAndReturnBB();
}
项目:SecureKeeper    文件:WatchLeakTest.java   
/**
 * Create a connection request
 *
 * @return a serialized connection request
 */
private ByteBuffer createConnRequest() {
    Random r = new Random(SESSION_ID ^ superSecret);
    byte p[] = new byte[16];
    r.nextBytes(p);
    ConnectRequest conReq = new ConnectRequest(0, 1L, 30000, SESSION_ID, p);
    MockPacket packet = new MockPacket(null, null, conReq, null, null, false);
    return packet.createAndReturnBB();
}
项目:StreamBench    文件:WatchLeakTest.java   
/**
 * Create a watches message with a single watch on /
 * 
 * @return
 */
private ByteBuffer createWatchesMessage() {
    List<String> dataWatches = new ArrayList<String>(1);
    dataWatches.add("/");
    List<String> existWatches = Collections.emptyList();
    List<String> childWatches = Collections.emptyList();
    SetWatches sw = new SetWatches(1L, dataWatches, existWatches,
            childWatches);
    RequestHeader h = new RequestHeader();
    h.setType(ZooDefs.OpCode.setWatches);
    h.setXid(-8);
    MockPacket p = new MockPacket(h, new ReplyHeader(), sw, null, null);
    return p.createAndReturnBB();
}
项目:StreamBench    文件:WatchLeakTest.java   
/**
 * Create a connection request
 * 
 * @return
 */
private ByteBuffer createConnRequest() {
    Random r = new Random(SESSION_ID ^ superSecret);
    byte p[] = new byte[16];
    r.nextBytes(p);
    ConnectRequest conReq = new ConnectRequest(0, 1L, 30000, SESSION_ID, p);
    MockPacket packet = new MockPacket(null, null, conReq, null, null, false);
    return packet.createAndReturnBB();
}