 
 (defn connect!
   "Connects and sets *default-cluster* and *default-session* for default cluster and session, that
-   cql/execute is going to use"
+   cql/execute is going to use."
   [hosts & {:as options}]
   (let [cluster (-> (Cluster/builder)
                     (copt/set-cluster-options! (assoc options :contact-points hosts))


(defn get-hosts
  "Returns all hosts for connected cluster"
  [^Session client]
  (map (fn [^Host host]
         {:datacenter (.getDatacenter host)
          :address    (.getHostAddress (.getAddress host))
          :rack       (.getRack host)})
       (-> client
           (.getCluster)
           (.getMetadata)
           (.getAllHosts))))


;; defn get-replicas
;; defn get-cluster-name

(defn exponential-reconnection-policy
  "Reconnection policy that waits exponentially longer between each
reconnection attempt (but keeps a constant delay once a maximum delay is
reached).

   Delays should be given in milliseconds"
  [base-delay-ms max-delay-ms]
  (ExponentialReconnectionPolicy. base-delay-ms max-delay-ms))

(defn constant-reconnection-policy
  "Reconnection policy that waits constantly longer between each
reconnection attempt (but keeps a constant delay once a maximum delay is
reached).

   Delay should be given in milliseconds"
  [delay-ms]
  (ConstantReconnectionPolicy. delay-ms))
