 (defn open-connection [{:keys [seeds ^Selector selector connections] :as client} address]
   (let [{:keys [^SocketChannel channel ^InetSocketAddress address] :as conn} (socket-connection address)]
     (if (.connect channel address)
-      (do (debug address "connection has been established immediately, registering" (ops->str OP_READ))
+      (do (trace address "connection has been established immediately, registering" (ops->str OP_READ))
           (.register channel selector OP_READ conn))
-      (do (debug address "connection cannot be established immediately, registering" (ops->str OP_CONNECT))
+      (do (trace address "connection cannot be established immediately, registering" (ops->str OP_CONNECT))
           (.register channel selector OP_CONNECT conn)))
     (swap! connections assoc address conn)
     conn))

(def OP_WRITE (SelectionKey/OP_WRITE))

(set! *warn-on-reflection* true)
;; (set! *unchecked-math* :warn-on-boxed)

(timbre/refer-timbre)

(def cluster-hash-slots 16384)

(defn drain
  "Drains items from q into a new collection."

   (let [current-ops (.interestOps k)
         new-ops     (bit-and current-ops (bit-not x))]
     (when (not= current-ops new-ops)
       (trace (remote-address k) "ignoring op" (ops->str current-ops) "->" (ops->str new-ops)))
     (.interestOps k new-ops))))

(defmulti dispatch
