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