Friday, November 17, 2017

Basic HBase in Clojure

(println (seq (.getURLs (java.lang.ClassLoader/getSystemClassLoader))) ;; get class path in REPL
# in REPL
(require '[clojure-hbase.core :as hbase])
(import [org.apache.hadoop.hbase HBaseConfiguration HConstants KeyValue])
(import [org.apache.hadoop.hbase.client HTablePool Get Put Delete Scan Result RowLock HTableInterface])

(hbase/set-config (hbase/make-config {
     :zookeeper.znode.parent "/hbase-unsecure" 
     :hbase.zookeeper.property.clientPort "2181"
     :hbase.cluster.distributed "true"
     :hbase.zookeeper.quorum "hdp005-3,hdp005-21,hdp005-23"
}
))
(hbase/table "tweets-test")

No comments: