int numData = CacheTestWriter.NUM_DATA;
File myfile = new File(reportDir + "/" + UUID.randomUUID());
myfile.deleteOnExit();
ZooCache zc = new ZooCache(keepers, 30000);
while (true) {
if (myfile.exists())
myfile.delete();
if (zc.get(rootDir + "/die") != null) {
return;
}
Map<String,String> readData = new TreeMap<String,String>();
for (int i = 0; i < numData; i++) {
byte[] v = zc.get(rootDir + "/data" + i);
if (v != null)
readData.put(rootDir + "/data" + i, new String(v, Constants.UTF8));
}
byte[] v = zc.get(rootDir + "/dataS");
if (v != null)
readData.put(rootDir + "/dataS", new String(v, Constants.UTF8));
List<String> children = zc.getChildren(rootDir + "/dir");
if (children != null)
for (String child : children) {
readData.put(rootDir + "/dir/" + child, "");
}