5758596061626364
zookeeper.create(nodeRootPath, new byte[0], CreateMode.PERSISTENT); } catch (ZkNodeExistsException e) { // 如果节点已经存在,则不抛异常 // ignore } catch (ZkException e) { throw new ArbitrateException("system_init", e); } }
7677787980818283
zookeeper.deleteRecursive(rootPath); // 删除节点,不关心版本 } catch (ZkNoNodeException e) { // 如果节点已经不存在,则不抛异常 // ignore } catch (ZkException e) { throw new ArbitrateException("system_destory", e); } }
102103104105106107108109
} } } catch (ZkNoNodeException e) { // ignore } catch (ZkException e) { throw new ArbitrateException("releaseMainStem", pipelineId.toString(), e); } }
5657585960616263
zookeeper.create(loadLockPath, new byte[0], CreateMode.PERSISTENT); } catch (ZkNodeExistsException e) { // 如果节点已经存在,则不抛异常 // ignore } catch (ZkException e) { throw new ArbitrateException("Pipeline_init", pipelineId.toString(), e); } }
8182838485868788
zookeeper.deleteRecursive(path); // 删除节点,不关心版本 } catch (ZkNoNodeException e) { // 如果节点已经不存在,则不抛异常 // ignore } catch (ZkException e) { throw new ArbitrateException("Pipeline_destory", pipelineId.toString(), e); } }
5051525354555657
String path = ManagePathUtils.getNode(nid); try { zookeeper.create(path, new byte[0], CreateMode.EPHEMERAL);// 创建为临时节点 } catch (ZkException e) { throw new ArbitrateException("Node_init", nid.toString(), e); } }
7071727374757677
zookeeper.delete(path); // 删除节点,不关心版本 } catch (ZkNoNodeException e) { // 如果节点已经不存在,则不抛异常 // ignore } catch (ZkException e) { throw new ArbitrateException("Node_destory", nid.toString(), e); } }
8889909192939495
result.add(Long.valueOf(nid)); } return result; } catch (ZkException e) { throw new ArbitrateException("liveNodes", e); } }
// 如果节点已经存在,则不抛异常 // ignore } catch (ZkNoNodeException e) { zookeeper.createPersistent(path, data, true);//创建父节点 } catch (ZkException e) { throw new ArbitrateException("Channel_init", channelId.toString(), e); } }
117118119120121122123124125126127
try { // 调用termin进行关闭 result |= termin(channelId, TerminType.ROLLBACK); } catch (Throwable e) { updateStatus(channelId, ChannelStatus.PAUSE); // 出错了,直接挂起 throw new ArbitrateException(e); } } return result && status; }