public void init(Long channelId) {
        String path = ManagePathUtils.getChannelByChannelId(channelId);
        byte[] data = JsonUtils.marshalToByte(ChannelStatus.STOP);// 初始化的数据对象

        try {
            zookeeper.create(path, data, CreateMode.PERSISTENT);
        } catch (ZkNodeExistsException e) {
            // 如果节点已经存在，则不抛异常
            // ignore
        } catch (ZkNoNodeException e) {
            zookeeper.createPersistent(path, data, true);//创建父节点
        } catch (ZkException e) {
            throw new ArbitrateException("Channel_init", channelId.toString(), e);
        }
    }
public void init ( Long channelId ) { String path = ManagePathUtils . getChannelByChannelId ( channelId ) ; byte [ ] data = JsonUtils . marshalToByte ( ChannelStatus . STOP ) ; try { zookeeper . create ( path , data , CreateMode . PERSISTENT ) ; } catch ( ZkNodeExistsException e ) { } catch ( ZkNoNodeException e ) { zookeeper . createPersistent ( path , data , true ) ; } catch ( ZkException e ) { throw new ArbitrateException ( "Channel_init" , channelId . toString ( ) , e ) ; } }
初始化对应的channel节点,同步调用