本文整理了Java中org.apache.helix.ZNRecord.setVersion()
方法的一些代码示例,展示了ZNRecord.setVersion()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZNRecord.setVersion()
方法的具体详情如下:
包路径:org.apache.helix.ZNRecord
类名称:ZNRecord
方法名:setVersion
[英]Set the version of this record
[中]设置此记录的版本
代码示例来源:origin: apache/incubator-pinot
@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;
}
代码示例来源:origin: apache/incubator-pinot
/**
* Read the segment merge lineage ZNRecord from the property store
*
* @param propertyStore a property store
* @param tableNameWithType a table name with type
* @return a ZNRecord of segment merge lineage, return null if znode does not exist
*/
public static ZNRecord getSegmentMergeLineageZNRecord(ZkHelixPropertyStore<ZNRecord> propertyStore,
String tableNameWithType) {
String path = ZKMetadataProvider.constructPropertyStorePathForSegmentMergeLineage(tableNameWithType);
Stat stat = new Stat();
ZNRecord segmentMergeLineageZNRecord = propertyStore.get(path, stat, AccessOption.PERSISTENT);
if (segmentMergeLineageZNRecord != null) {
segmentMergeLineageZNRecord.setVersion(stat.getVersion());
}
return segmentMergeLineageZNRecord;
}
代码示例来源:origin: apache/incubator-pinot
Stat stat = instanceConfigStatMap.get(instanceConfig.getInstanceName());
if (stat != null) {
instanceConfig.getRecord().setVersion(stat.getVersion());
代码示例来源:origin: org.apache.helix/helix-core
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;
}
代码示例来源:origin: apache/helix
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;
}
代码示例来源:origin: org.apache.helix/helix-core
record.setCreationTime(stat.getCtime());
record.setModifiedTime(stat.getMtime());
record.setVersion(stat.getVersion());
代码示例来源:origin: apache/helix
record.setCreationTime(stat.getCtime());
record.setModifiedTime(stat.getMtime());
record.setVersion(stat.getVersion());
record.setEphemeralOwner(stat.getEphemeralOwner());
代码示例来源:origin: org.apache.helix/helix-core
record.setCreationTime(stat.getCtime());
record.setModifiedTime(stat.getMtime());
record.setVersion(stat.getVersion());
代码示例来源:origin: apache/helix
record.setCreationTime(stat.getCtime());
record.setModifiedTime(stat.getMtime());
record.setVersion(stat.getVersion());
record.setEphemeralOwner(stat.getEphemeralOwner());
代码示例来源:origin: apache/helix
copy.setVersion(record.getVersion());
copy.setCreationTime(record.getCreationTime());
copy.setModifiedTime(record.getModifiedTime());
内容来源于网络,如有侵权,请联系作者删除!