public boolean check() {
String path = StagePathUtils.getMainStem(getPipelineId());
try {
byte[] bytes = zookeeper.readData(path);
Long nid = ArbitrateConfigUtils.getCurrentNid();
MainStemEventData eventData = JsonUtils.unmarshalFromByte(bytes, MainStemEventData.class);
activeData = eventData;// 更新下为最新值
// 检查下nid是否为自己
boolean result = nid.equals(eventData.getNid());
if (!result) {
logger.warn("mainstem is running in node[{}] , but not in node[{}]", eventData.getNid(), nid);
}
return result;
} catch (ZkNoNodeException e) {
logger.warn("mainstem is not run any in node");
return false;