public static List<ZNRecord> getChildren(HelixZkClient client, String path) { // parent watch will be set by zkClient List<String> children = client.getChildren(path); if (children == null || children.size() == 0) { return Collections.emptyList(); } List<ZNRecord> childRecords = new ArrayList<ZNRecord>(); for (String child : children) { String childPath = path + "/" + child; Stat newStat = new Stat(); ZNRecord record = client.readDataAndStat(childPath, newStat, true); if (record != null) { record.setVersion(newStat.getVersion()); record.setCreationTime(newStat.getCtime()); record.setModifiedTime(newStat.getMtime()); record.setEphemeralOwner(newStat.getEphemeralOwner()); childRecords.add(record); } } return childRecords; }
record.setModifiedTime(stat.getMtime()); record.setVersion(stat.getVersion()); record.setEphemeralOwner(stat.getEphemeralOwner());
record.setModifiedTime(stat.getMtime()); record.setVersion(stat.getVersion()); record.setEphemeralOwner(stat.getEphemeralOwner());
copy.setCreationTime(record.getCreationTime()); copy.setModifiedTime(record.getModifiedTime()); copy.setEphemeralOwner(record.getEphemeralOwner());