CreateMode.PERSISTENT);
}
Assert.assertTrue("size of the acl map ", (1 == zks.getZKDatabase().getAclSize()));
for (int j = 100; j < 200; j++) {
path = "/" + j;
ACL acl = new ACL();
acl.setPerms(0);
Id id = new Id();
id.setId("1.1.1."+j);
id.setScheme("ip");
acl.setId(id);
ArrayList<ACL> list = new ArrayList<ACL>();
list.add(acl);
zk.create(path, path.getBytes(), list, CreateMode.PERSISTENT);
}
Assert.assertTrue("size of the acl map ", (101 == zks.getZKDatabase().getAclSize()));
} finally {
// now shutdown the server and restart it
f.shutdown();
zks.shutdown();
Assert.assertTrue("waiting for server down",
ClientBase.waitForServerDown(HOSTPORT, CONNECTION_TIMEOUT));
}
startSignal = new CountDownLatch(1);
zks = new ZooKeeperServer(tmpDir, tmpDir, 3000);
f = ServerCnxnFactory.createFactory(PORT, -1);
f.startup(zks);
try {
Assert.assertTrue("waiting for server up",
ClientBase.waitForServerUp(HOSTPORT, CONNECTION_TIMEOUT));
startSignal.await(CONNECTION_TIMEOUT,
TimeUnit.MILLISECONDS);
Assert.assertTrue("count == 0", startSignal.getCount() == 0);
Assert.assertTrue("acl map ", (101 == zks.getZKDatabase().getAclSize()));
for (int j = 200; j < 205; j++) {
path = "/" + j;
ACL acl = new ACL();
acl.setPerms(0);
Id id = new Id();
id.setId("1.1.1."+j);
id.setScheme("ip");
acl.setId(id);
ArrayList<ACL> list = new ArrayList<ACL>();
list.add(acl);
zk.create(path, path.getBytes(), list, CreateMode.PERSISTENT);
}
Assert.assertTrue("acl map ", (106 == zks.getZKDatabase().getAclSize()));