gpt4 book ai didi

org.apache.helix.ZNRecord.setVersion()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 06:54:40 29 4
gpt4 key购买 nike

本文整理了Java中org.apache.helix.ZNRecord.setVersion()方法的一些代码示例,展示了ZNRecord.setVersion()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZNRecord.setVersion()方法的具体详情如下:
包路径:org.apache.helix.ZNRecord
类名称:ZNRecord
方法名:setVersion

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());

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com