/** * Close resources like zookeeper, thread pool */ protected void close() throws InterruptedException { if(this.zkHeartBeatEnabled) { stopHeartBeat(); } if(getZooKeeper() != null) { getZooKeeper().close(); } // shut down thread pool this.threadPool.shutdownNow(); this.threadPool.awaitTermination(2, TimeUnit.SECONDS); }
if(bytes.length > zkDataLimit) { getZooKeeper().createExt(splitZnode, null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT, true); int childrenSize = (bytes.length % zkDataLimit == 0) ? (bytes.length / zkDataLimit) : (bytes.length / zkDataLimit) + 1; getZooKeeper().createExt(znode, null, Ids.OPEN_ACL_UNSAFE, createNode, false); return true; } else { getZooKeeper().createExt(znode, bytes, Ids.OPEN_ACL_UNSAFE, createNode, false); return false;
byte[] data = getZooKeeper().getData(znode, null, null); if(data != null) { return data; final List<String> children = getZooKeeper().getChildrenExt(splitZnode, false, true, new ChildrenComparator()); if(children == null || children.size() == 0) { return null; for(int i = 0; i < children.size(); i++) { final int index = i; completionService.submit(new GetSplitBytes(getZooKeeper(), index, children.get(index)));
if(getZooKeeper() == null) { try { String zkServers = props.getProperty(GuaguaConstants.GUAGUA_ZK_SERVERS);