             [onyx.peer.operation :refer [kw->fn]]
             [onyx.types :refer [dec-count! inc-count!]]
             [taoensso.timbre :refer [info error debug fatal]])
-  (:import [org.apache.zookeeper KeeperException$BadVersionException]
+  (:import [org.apache.zookeeper KeeperException$BadVersionException KeeperException$ConnectionLossException]
            [org.apache.bookkeeper.client LedgerHandle LedgerEntry BookKeeper BKException$Code
             BookKeeper$DigestType AsyncCallback$AddCallback]))
 

                          commit-ch
                          shutdown-ch)))

(def read-ledgers-calls
  {:lifecycle/before-task-start inject-read-ledgers-resources
   :lifecycle/after-task-stop close-read-ledgers-resources})

;;;;;;;;;;;;;

  (.close client)
  {})

(defn write-handle-exception [event lifecycle lf-kw exception]
  (cond (= exception org.apache.zookeeper.KeeperException$ConnectionLossException)
        :restart
        :else :defer))

(def write-ledger-calls
  {:lifecycle/before-task-start inject-write-ledger-resources
   :lifecycle/handle-exception write-handle-exception
   :lifecycle/after-task-stop close-write-ledger-resources})

(def HandleWriteCallback
