 (defn create
   [^CuratorFramework client path & {:keys [data] :as opts}]
   (try 
-    (let [cr (.. client 
+    (let [cr ^SetDataBuilder (.. client 
                  create 
                  (withMode (create-mode opts)))]
       (if data 
-        (.forPath cr path data)
-        (.forPath cr path)))
+        (.forPath ^SetDataBuilder cr path data)
+        (.forPath ^SetDataBuilder cr path)))
     (catch org.apache.zookeeper.KeeperException$NodeExistsException e
       false)))
 

(ns onyx.log.curator
  (:require [clojure.core.async :refer [chan >!! <!! close! thread]]
            [taoensso.timbre :refer [fatal warn trace]]
            [onyx.static.default-vals :refer [defaults]]
            [zookeeper :as zk]
            [zookeeper.internal :as zi])
  (:import [org.apache.zookeeper CreateMode]
           [org.apache.zookeeper KeeperException$NoNodeException KeeperException$NodeExistsException]
           [org.apache.curator.test TestingServer]
           [org.apache.zookeeper.data Stat]
           [org.apache.curator.framework CuratorFrameworkFactory CuratorFramework]
           [org.apache.curator.framework.api CuratorWatcher PathAndBytesable Versionable]
           [org.apache.curator.framework.state ConnectionStateListener ConnectionState]
           [org.apache.curator.framework.imps CuratorFrameworkState]
           [org.apache.curator RetryPolicy]
           [org.apache.curator.retry BoundedExponentialBackoffRetry]))

(defn ^CuratorFramework connect
  ([connection-string]

                 creatingParentsIfNeeded 
                 (withMode (create-mode opts)))]
      (if data 
        (.forPath ^SetDataBuilder cr path data)
        (.forPath ^SetDataBuilder cr path)))
    (catch org.apache.zookeeper.KeeperException$NodeExistsException e
      false) ))

