if (!needRead[i]) {
continue;
}
String path = paths.get(i);
cbList[i] = new GetDataCallbackHandler();
_zkClient.asyncGetData(path, cbList[i]);
}
// wait for completion
for (int i = 0; i < size; i++) {
if (!needRead[i]) {
continue;
}
GetDataCallbackHandler cb = cbList[i];
cb.waitForSuccess();
}
// construct return results
for (int i = 0; i < paths.size(); i++) {
if (!needRead[i]) {
continue;
}
GetDataCallbackHandler cb = cbList[i];
switch (Code.get(cb.getRc())) {
case OK: {
@SuppressWarnings("unchecked")
T value = (T) _zkClient.deserialize(cb._data, paths.get(i));
results.set(i, new AccessResult(RetCode.OK, null, cb._stat, value));
break;