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

x33g5p2x  于2022-02-05 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(88)

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

ZNRecord.setEphemeralOwner介绍

[英]Set the session Id of ephemeral node owner
[中]设置临时节点所有者的会话Id

代码示例

代码示例来源: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: apache/helix

record.setModifiedTime(stat.getMtime());
record.setVersion(stat.getVersion());
record.setEphemeralOwner(stat.getEphemeralOwner());

代码示例来源:origin: apache/helix

record.setModifiedTime(stat.getMtime());
record.setVersion(stat.getVersion());
record.setEphemeralOwner(stat.getEphemeralOwner());

代码示例来源:origin: apache/helix

copy.setCreationTime(record.getCreationTime());
copy.setModifiedTime(record.getModifiedTime());
copy.setEphemeralOwner(record.getEphemeralOwner());

相关文章