/// <summary>Pre-creating bookkeeper metadata path in zookeeper.</summary> /// <exception cref="System.IO.IOException"/> private void PrepareBookKeeperEnv() { // create bookie available path in zookeeper if it doesn't exists string zkAvailablePath = conf.Get(BkjmZkLedgersAvailablePath, BkjmZkLedgersAvailablePathDefault ); CountDownLatch zkPathLatch = new CountDownLatch(1); AtomicBoolean success = new AtomicBoolean(false); AsyncCallback.StringCallback callback = new _StringCallback_255(zkAvailablePath, success, zkPathLatch); ZkUtils.AsyncCreateFullPathOptimistic(zkc, zkAvailablePath, new byte[0], ZooDefs.Ids .OpenAclUnsafe, CreateMode.Persistent, callback, null); try { if (!zkPathLatch.Await(zkc.GetSessionTimeout(), TimeUnit.Milliseconds) || !success .Get()) { throw new IOException("Couldn't create bookie available path :" + zkAvailablePath + ", timed out " + zkc.GetSessionTimeout() + " millis"); } } catch (Exception e) { Sharpen.Thread.CurrentThread().Interrupt(); throw new IOException("Interrupted when creating the bookie available path : " + zkAvailablePath, e); } }