       (.withLoadBalancingPolicy builder load-balancing-policy))
     (.build builder)))
 
-(defn ^SessionManager connect
+(defn ^Session connect
   "Connects to the Cassandra cluster. Use `build` function to build cluster with all required options."
   ([^Cluster cluster]
      (flush-prepared-statement-cache!)


(defn get-hosts
  "Returns all nodes in the cluster"
  [^SessionManager session]
  (map (fn [^Host host]
         {:datacenter (.getDatacenter host)
          :address    (.getHostAddress (.getAddress host))

    session))

(defn disconnect!
  "0-arity version disconnects the (only) active Session and shuts down the cluster.

   1-arity version receives Session, and shuts it down. It doesn't shut down all other sessions
   on same cluster."
  ([]
     (.shutdown *default-session*)
     (.shutdown *default-cluster*))
  ([^Session session]
     (.shutdown session)))

(defn shutdown-cluster
