     "SELECT path,data,time FROM metric WHERE "
     "path = ? AND tenant = ? AND rollup = ? AND period = ? "
     "AND time >= ? AND time <= ? ORDER BY time ASC;")))
+
+(defn my-deref
+  [f]
+  (let [result (deref f 300000 :timeout)]
+    (when (= result :timeout)
+      (throw (ex-info "Too long!" {})))
+    result))
 
 (defn par-fetch
   "Fetch data in parallel fashion."

  [f-par-fetch host paths tenant rollup period from to]
  (println "Connecting to Cassandra...")
  (let [cluster (alia/cluster {:contact-points [host]})
        session (alia/connect keyspace cluster)
        fetch! (fetchq session)]
    (println "Getting data form Cassandra...")
    (try

                           (shutdown-agents)
                           (throw e))))
                    paths))]
    (map my-deref futures)))

(defn par-fetch-pmap
  "Fetch data in parallel fashion using pmap."
