本文整理了Java中org.apache.samza.zk.ZkUtils.readProcessorData()
方法的一些代码示例,展示了ZkUtils.readProcessorData()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkUtils.readProcessorData()
方法的具体详情如下:
包路径:org.apache.samza.zk.ZkUtils
类名称:ZkUtils
方法名:readProcessorData
[英]Method is used to read processor's data from the znode
[中]方法用于从znode读取处理器的数据
代码示例来源:origin: apache/samza
/**
* Method is used to get the <i>sorted</i> list of processors ids for a given list of znodes
* @param znodeIds - list of relative paths of the children's znodes
* @return List of processor ids for a given list of znodes
*/
public List<String> getActiveProcessorsIDs(List<String> znodeIds) {
String processorPath = keyBuilder.getProcessorsPath();
List<String> processorIds = new ArrayList<>(znodeIds.size());
if (znodeIds.size() > 0) {
for (String child : znodeIds) {
String fullPath = String.format("%s/%s", processorPath, child);
String processorData = readProcessorData(fullPath);
if (processorData != null) {
processorIds.add(new ProcessorData(processorData).getProcessorId());
}
}
Collections.sort(processorIds);
LOG.info("Found these children - " + znodeIds);
LOG.info("Found these processorIds - " + processorIds);
}
return processorIds;
}
代码示例来源:origin: org.apache.samza/samza-core_2.10
/**
* Method is used to get the <i>sorted</i> list of processors ids for a given list of znodes
* @param znodeIds - list of relative paths of the children's znodes
* @return List of processor ids for a given list of znodes
*/
public List<String> getActiveProcessorsIDs(List<String> znodeIds) {
String processorPath = keyBuilder.getProcessorsPath();
List<String> processorIds = new ArrayList<>(znodeIds.size());
if (znodeIds.size() > 0) {
for (String child : znodeIds) {
String fullPath = String.format("%s/%s", processorPath, child);
String processorData = readProcessorData(fullPath);
if (processorData != null) {
processorIds.add(new ProcessorData(processorData).getProcessorId());
}
}
Collections.sort(processorIds);
LOG.info("Found these children - " + znodeIds);
LOG.info("Found these processorIds - " + processorIds);
}
return processorIds;
}
代码示例来源:origin: org.apache.samza/samza-core_2.11
/**
* Method is used to get the <i>sorted</i> list of processors ids for a given list of znodes
* @param znodeIds - list of relative paths of the children's znodes
* @return List of processor ids for a given list of znodes
*/
public List<String> getActiveProcessorsIDs(List<String> znodeIds) {
String processorPath = keyBuilder.getProcessorsPath();
List<String> processorIds = new ArrayList<>(znodeIds.size());
if (znodeIds.size() > 0) {
for (String child : znodeIds) {
String fullPath = String.format("%s/%s", processorPath, child);
String processorData = readProcessorData(fullPath);
if (processorData != null) {
processorIds.add(new ProcessorData(processorData).getProcessorId());
}
}
Collections.sort(processorIds);
LOG.info("Found these children - " + znodeIds);
LOG.info("Found these processorIds - " + processorIds);
}
return processorIds;
}
代码示例来源:origin: org.apache.samza/samza-core_2.12
/**
* Method is used to get the <i>sorted</i> list of processors ids for a given list of znodes
* @param znodeIds - list of relative paths of the children's znodes
* @return List of processor ids for a given list of znodes
*/
public List<String> getActiveProcessorsIDs(List<String> znodeIds) {
String processorPath = keyBuilder.getProcessorsPath();
List<String> processorIds = new ArrayList<>(znodeIds.size());
if (znodeIds.size() > 0) {
for (String child : znodeIds) {
String fullPath = String.format("%s/%s", processorPath, child);
String processorData = readProcessorData(fullPath);
if (processorData != null) {
processorIds.add(new ProcessorData(processorData).getProcessorId());
}
}
Collections.sort(processorIds);
LOG.info("Found these children - " + znodeIds);
LOG.info("Found these processorIds - " + processorIds);
}
return processorIds;
}
代码示例来源:origin: org.apache.samza/samza-core
/**
* Method is used to get the <i>sorted</i> list of processors ids for a given list of znodes
* @param znodeIds - list of relative paths of the children's znodes
* @return List of processor ids for a given list of znodes
*/
public List<String> getActiveProcessorsIDs(List<String> znodeIds) {
String processorPath = keyBuilder.getProcessorsPath();
List<String> processorIds = new ArrayList<>(znodeIds.size());
if (znodeIds.size() > 0) {
for (String child : znodeIds) {
String fullPath = String.format("%s/%s", processorPath, child);
String processorData = readProcessorData(fullPath);
if (processorData != null) {
processorIds.add(new ProcessorData(processorData).getProcessorId());
}
}
Collections.sort(processorIds);
LOG.info("Found these children - " + znodeIds);
LOG.info("Found these processorIds - " + processorIds);
}
return processorIds;
}
代码示例来源:origin: org.apache.samza/samza-core
/**
* Fetches all the ephemeral processor nodes of a standalone job from zookeeper.
* @return a list of {@link ProcessorNode}, where each ProcessorNode represents a registered stream processor.
*/
List<ProcessorNode> getAllProcessorNodes() {
List<String> processorZNodes = getSortedActiveProcessorsZnodes();
LOG.debug("Active ProcessorZNodes in zookeeper: {}.", processorZNodes);
List<ProcessorNode> processorNodes = new ArrayList<>();
for (String processorZNode: processorZNodes) {
String ephemeralProcessorPath = String.format("%s/%s", keyBuilder.getProcessorsPath(), processorZNode);
String data = readProcessorData(ephemeralProcessorPath);
if (data != null) {
processorNodes.add(new ProcessorNode(new ProcessorData(data), ephemeralProcessorPath));
}
}
return processorNodes;
}
代码示例来源:origin: org.apache.samza/samza-core_2.12
/**
* Fetches all the ephemeral processor nodes of a standalone job from zookeeper.
* @return a list of {@link ProcessorNode}, where each ProcessorNode represents a registered stream processor.
*/
List<ProcessorNode> getAllProcessorNodes() {
List<String> processorZNodes = getSortedActiveProcessorsZnodes();
LOG.debug("Active ProcessorZNodes in zookeeper: {}.", processorZNodes);
List<ProcessorNode> processorNodes = new ArrayList<>();
for (String processorZNode: processorZNodes) {
String ephemeralProcessorPath = String.format("%s/%s", keyBuilder.getProcessorsPath(), processorZNode);
String data = readProcessorData(ephemeralProcessorPath);
if (data != null) {
processorNodes.add(new ProcessorNode(new ProcessorData(data), ephemeralProcessorPath));
}
}
return processorNodes;
}
代码示例来源:origin: apache/samza
/**
* Fetches all the ephemeral processor nodes of a standalone job from zookeeper.
* @return a list of {@link ProcessorNode}, where each ProcessorNode represents a registered stream processor.
*/
List<ProcessorNode> getAllProcessorNodes() {
List<String> processorZNodes = getSortedActiveProcessorsZnodes();
LOG.debug("Active ProcessorZNodes in zookeeper: {}.", processorZNodes);
List<ProcessorNode> processorNodes = new ArrayList<>();
for (String processorZNode: processorZNodes) {
String ephemeralProcessorPath = String.format("%s/%s", keyBuilder.getProcessorsPath(), processorZNode);
String data = readProcessorData(ephemeralProcessorPath);
if (data != null) {
processorNodes.add(new ProcessorNode(new ProcessorData(data), ephemeralProcessorPath));
}
}
return processorNodes;
}
代码示例来源:origin: org.apache.samza/samza-core_2.11
/**
* Fetches all the ephemeral processor nodes of a standalone job from zookeeper.
* @return a list of {@link ProcessorNode}, where each ProcessorNode represents a registered stream processor.
*/
List<ProcessorNode> getAllProcessorNodes() {
List<String> processorZNodes = getSortedActiveProcessorsZnodes();
LOG.debug("Active ProcessorZNodes in zookeeper: {}.", processorZNodes);
List<ProcessorNode> processorNodes = new ArrayList<>();
for (String processorZNode: processorZNodes) {
String ephemeralProcessorPath = String.format("%s/%s", keyBuilder.getProcessorsPath(), processorZNode);
String data = readProcessorData(ephemeralProcessorPath);
if (data != null) {
processorNodes.add(new ProcessorNode(new ProcessorData(data), ephemeralProcessorPath));
}
}
return processorNodes;
}
代码示例来源:origin: org.apache.samza/samza-core_2.10
/**
* Fetches all the ephemeral processor nodes of a standalone job from zookeeper.
* @return a list of {@link ProcessorNode}, where each ProcessorNode represents a registered stream processor.
*/
List<ProcessorNode> getAllProcessorNodes() {
List<String> processorZNodes = getSortedActiveProcessorsZnodes();
LOG.debug("Active ProcessorZNodes in zookeeper: {}.", processorZNodes);
List<ProcessorNode> processorNodes = new ArrayList<>();
for (String processorZNode: processorZNodes) {
String ephemeralProcessorPath = String.format("%s/%s", keyBuilder.getProcessorsPath(), processorZNode);
String data = readProcessorData(ephemeralProcessorPath);
if (data != null) {
processorNodes.add(new ProcessorNode(new ProcessorData(data), ephemeralProcessorPath));
}
}
return processorNodes;
}
内容来源于网络,如有侵权,请联系作者删除!