サンプルコード
@Grab(group='org.apache.zookeeper', module='zookeeper', version='3.4.6') import org.apache.zookeeper.* def zk = new ZooKeeper("localhost:2181", 3000, null) try { zk.create("/test1", "sample1".getBytes("UTF-8"), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT) for(child in zk.getChildren("/", false)){ println child } } finally { zk.close() }動作環境
groovy 2.3.6, JDK 7 Update 65, Hadoop 2.5.0, zookeeper 3.4.6
0 件のコメント:
コメントを投稿