public List<Long> liveNodes() {
        String path = ArbitrateConstants.NODE_NID_ROOT;
        try {
            List<String> nids = zookeeper.getChildren(path);
            List<Long> result = new ArrayList<Long>();
            for (String nid : nids) {
                result.add(Long.valueOf(nid));
            }

            return result;
        } catch (ZkException e) {
            throw new ArbitrateException("liveNodes", e);
        }
    }
public List < Long > liveNodes ( ) { String path = ArbitrateConstants . NODE_NID_ROOT ; try { List < String > nids = zookeeper . getChildren ( path ) ; List < Long > result = new ArrayList < Long > ( ) ; for ( String nid : nids ) { result . add ( Long . valueOf ( nid ) ) ; } return result ; } catch ( ZkException e ) { throw new ArbitrateException ( "liveNodes" , e ) ; } }
获取当前存活的节点列表