diff --git a/project.clj b/project.clj index 820d714..3bff02d 100644 --- a/project.clj +++ b/project.clj @@ -5,11 +5,9 @@ :url "http://opensource.org/licenses/MIT"} :dependencies [[org.clojure/clojure "1.6.0"] - [org.clojure/core.async "0.1.346.0-17112a-alpha"] [swiss-arrows "1.0.0"] [clj-http "1.0.1"] [prismatic/schema "0.4.2"] [org.clojure/tools.logging "0.3.0"] [org.clojure/data.json "0.2.5"] - [smichal/curator "0.0.6"] [zookeeper-clj "0.9.1"]]) diff --git a/src/clj_druid/client.clj b/src/clj_druid/client.clj index 14b1715..a1f2a06 100644 --- a/src/clj_druid/client.clj +++ b/src/clj_druid/client.clj @@ -5,9 +5,7 @@ [clj-druid.schemas.query :as sch] [clj-druid.validations :as v] [swiss.arrows :refer :all] - [clj-http.client :as http] - [clojure.core.async :refer [put! chan ! >!! go timeout close!]])) - + [clj-http.client :as http])) (def default-timeout 5000) @@ -15,12 +13,9 @@ "contains all zk nodes discovered" (atom [])) - (defn reset-node-list "update node list atom" [nodes] - - (println nodes) (reset! nodes-list nodes)) (defn make-node-path @@ -29,7 +24,6 @@ (str discovery-path "/" node-type)) - (defn make-host-http-str "make an http url string from a zk node entry" [c] @@ -40,7 +34,6 @@ (get c "port") "/druid/v2/")) - (defn zk-watch-node-list "Retrieve hosts from zk discovery" [zk-client path] @@ -73,11 +66,9 @@ [hosts] (reset-node-list hosts)) - (defn randomized "Take a random host" [] - (if (empty? @nodes-list) (throw (Exception. "No druid node available for query"))) @@ -89,19 +80,16 @@ [] (first @nodes-list)) - (defn connect "Create a druid client from zk or a user defined host" [params] - (if (:zk params) (from-zookeeper (:zk params)) (from-user (:hosts params)))) - (defn query - "Issue a druid query using http-kit client in async mode" + "Issue a druid query" [balance-strategy query-type druid-query & params] (let [params (apply hash-map params) @@ -111,5 +99,4 @@ (json/write-str <>) {:body <> :as :text} (merge params))] - (http/post (balance-strategy) options)))