Package org.apache.zookeeper

Examples of org.apache.zookeeper.ZooKeeper.sync()


           
            LOG.info("Beginning test:" + (new Date()).toString());
            for(int i = 0; i < 100; i++)
                zk.create("/test" + i, new byte[0], Ids.OPEN_ACL_UNSAFE,
                        CreateMode.PERSISTENT, this, results);
            zk.sync("/test", this, results);
            for(int i = 0; i < 100; i++)
                zk.delete("/test" + i, 0, this, results);
            for(int i = 0; i < 100; i++)
                zk.getChildren("/", new NullWatcher(), this, results);
View Full Code Here


           
            LOG.info("Beginning test:" + (new Date()).toString());
            for(int i = 0; i < 100; i++)
                zk.create("/test" + i, new byte[0], Ids.OPEN_ACL_UNSAFE,
                        CreateMode.PERSISTENT, this, results);
            zk.sync("/test", this, results);
            for(int i = 0; i < 100; i++)
                zk.delete("/test" + i, 0, this, results);
            for(int i = 0; i < 100; i++)
                zk.getChildren("/", new NullWatcher(), (ChildrenCallback)this,
                        results);
View Full Code Here

           
            LOG.info("Beginning test:" + (new Date()).toString());
            for(int i = 0; i < 100; i++)
                zk.create("/test" + i, new byte[0], Ids.OPEN_ACL_UNSAFE,
                        CreateMode.PERSISTENT, this, results);
            zk.sync("/test", this, results);
            for(int i = 0; i < 100; i++)
                zk.delete("/test" + i, 0, this, results);
            for(int i = 0; i < 100; i++)
                zk.getChildren("/", new NullWatcher(), (ChildrenCallback)this,
                        results);
View Full Code Here

    log.info("Called sync() on client " + this.clientNumber);
    final CountDownLatch waitForSync = new CountDownLatch(1);
    final ZooKeeper c = getClient();
    assert c.getState().isAlive();

    c.sync("/", new AsyncCallback.VoidCallback() {
      @Override
      public void processResult(int rc, String path, Object ctx) {
        log.info("Sync callback triggered on client " + RobustZooKeeper.this.clientNumber);
        waitForSync.countDown();
      }
View Full Code Here

            for(int i = 50; i < 100; i++) {
              zk.create("/test" + i, new byte[0], Ids.OPEN_ACL_UNSAFE,
                        CreateMode.PERSISTENT, (Create2Callback)this, results);
            }
            zk.sync("/test", this, results);
            for(int i = 0; i < 100; i++)
                zk.delete("/test" + i, 0, this, results);
            for(int i = 0; i < 100; i++)
                zk.getChildren("/", new NullWatcher(), (ChildrenCallback)this,
                        results);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.