@Nullable public static ZNRecord getZnRecord(@Nonnull ZkHelixPropertyStore<ZNRecord> propertyStore, @Nonnull String path) { Stat stat = new Stat(); ZNRecord znRecord = propertyStore.get(path, stat, AccessOption.PERSISTENT); if (znRecord != null) { znRecord.setCreationTime(stat.getCtime()); znRecord.setModifiedTime(stat.getMtime()); znRecord.setVersion(stat.getVersion()); } return znRecord; }
public static List<ZNRecord> getChildren(ZkClient 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()); childRecords.add(record); } } return childRecords; }
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; }
int options = constructOptions(type); if (record != null) { record.setCreationTime(stat.getCtime()); record.setModifiedTime(stat.getMtime()); record.setVersion(stat.getVersion());
int options = constructOptions(type); if (record != null) { record.setCreationTime(stat.getCtime()); record.setModifiedTime(stat.getMtime()); record.setVersion(stat.getVersion());
record = _baseDataAccessor.get(path, stat, options); if (record != null) { record.setCreationTime(stat.getCtime()); record.setModifiedTime(stat.getMtime()); record.setVersion(stat.getVersion());
record = _baseDataAccessor.get(path, stat, options); if (record != null) { record.setCreationTime(stat.getCtime()); record.setModifiedTime(stat.getMtime()); record.setVersion(stat.getVersion());
copy.setCreationTime(record.getCreationTime()); copy.setModifiedTime(record.getModifiedTime()); copy.setEphemeralOwner(record.getEphemeralOwner());