try {
byte[] data = zookeeper.readData(path);
EtlEventData eventData = JsonUtils.unmarshalFromByte(data, EtlEventData.class);
Node node = LoadBalanceFactory.getNextTransformNode(pipelineId);// 获取下一个处理节点信息
if (node == null) {// 没有后端节点
// TerminEventData termin = new TerminEventData();
// termin.setPipelineId(pipelineId);
// termin.setType(TerminType.ROLLBACK);
// termin.setCode("no_node");
// termin.setDesc(MessageFormat.format("pipeline[{}] extract stage has no node!", pipelineId));
// terminEvent.single(termin);
throw new ArbitrateException("Extract_single", "no next node");
} else {
eventData.setNextNid(node.getId());
return eventData;// 只有这一条路返回
}
} catch (ZkNoNodeException e) {
logger.error("pipeline[{}] processId[{}] is invalid , retry again", pipelineId, processId);
return await(pipelineId);// /出现节点不存在,说明出现了error情况,递归调用重新获取一次