davidsantiago / clojure-hbase Goto Github PK
View Code? Open in Web Editor NEWA simple library for accessing HBase conveniently from Clojure.
A simple library for accessing HBase conveniently from Clojure.
Multiple records should be inserted in the test case, so we know the difference between (as-map)
and (latest-as-map)
.
According to 5.9 Versions, one should call Get.setMaxVersions()
in order to obtain more than one version. Need some clarification from David.
Thanks!
I'm just getting started with HBase, but at least the O'Reilly HBase book claims best practice as: "Use the administrative API instance for the operation required and discard it afterward. In other words, you should not hold on to the instance for too long." Would you be open to a PR modifying the clojure-hbase.admin
namespace functions to take an explicit HBaseAdmin
object?
Changing clojure 1.4.0 to 1.5.1 makes put fails with:
java.lang.IllegalArgumentException: contains? not supported on type: clojure.lang.Keyword
at clojure.lang.RT.contains (RT.java:724)
clojure.core$contains_QMARK_.invoke (core.clj:1402)
clojure_hbase.core$make_put.invoke (core.clj:373)
clojure_hbase.core$put_STAR_.doInvoke (core.clj:397)
clojure.lang.RestFn.applyTo (RestFn.java:139)
clojure.core$apply.invoke (core.clj:619)
clojure_hbase.core$put.doInvoke (core.clj:409)
clojure.lang.RestFn.invoke (RestFn.java:464)
clojure_hbase.core_test/fn (core_test.clj:199)
clojure.test$test_var$fn__7145.invoke (test.clj:701)
Calling hbase-clojure.core/set-config
creates a HTablePool
with the given config. However leaves *admin*
pointing to a HBaseAdmin
object with a default config.
It would be nice if set-config would also reset *admin*
. Another option would be to provide something like hbase-clojure.admin/set-config
.
Please discuss. I'm can follow up with a patch next week.
To delete all versions of a column, we call .deleteColumns without the timestamp.
We may either fix :columns
or add a new keyword :all-versions
for the purpose.
Thanks.
I got the following exception trace when doing (require ['clojure-hbase.core :as 'hb])
(from README examples) for dependency [clojure-hbase "0.90.5-3"]
:
java.lang.ClassNotFoundException: org/apache/hadoop/hbase/client/Put, compiling:(core.clj:10)
at clojure.lang.Compiler$StaticMethodExpr.eval(Compiler.java:1583)
at clojure.lang.Compiler$DefExpr.eval(Compiler.java:398)
at clojure.lang.Compiler.eval(Compiler.java:6516)
at clojure.lang.Compiler.load(Compiler.java:6952)
at clojure.lang.RT.loadResourceScript(RT.java:359)
at clojure.lang.RT.loadResourceScript(RT.java:350)
at clojure.lang.RT.load(RT.java:429)
at clojure.lang.RT.load(RT.java:400)
at clojure.core$load$fn__4890.invoke(core.clj:5415)
at clojure.core$load.doInvoke(core.clj:5414)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5227)
at clojure.core$load_lib.doInvoke(core.clj:5264)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:603)
at clojure.core$load_libs.doInvoke(core.clj:5298)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:603)
at clojure.core$require.doInvoke(core.clj:5381)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at user$eval37.invoke(inspect.clj:6)
at clojure.lang.Compiler.eval(Compiler.java:6511)
at clojure.lang.Compiler.load(Compiler.java:6952)
at clojure.lang.Compiler.loadFile(Compiler.java:6912)
at clojure.lang.RT$3.invoke(RT.java:307)
at leiningen.exec$eval_script$fn__11.invoke(exec.clj:84)
at leiningen.exec$eval_script.invoke(exec.clj:83)
at leiningen.exec$exec.doInvoke(exec.clj:115)
at clojure.lang.RestFn.invoke(RestFn.java:423)
at clojure.lang.Var.invoke(Var.java:419)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.core$apply.invoke(core.clj:603)
at leiningen.core.main$resolve_task$fn__718.doInvoke(main.clj:68)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.lang.AFunction$1.doInvoke(AFunction.java:29)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:603)
at leiningen.core.main$apply_task.invoke(main.clj:90)
at leiningen.core.main$_main$fn__750.invoke(main.clj:143)
at leiningen.core.main$_main.doInvoke(main.clj:143)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:419)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.core$apply.invoke(core.clj:601)
at clojure.main$main_opt.invoke(main.clj:324)
at clojure.main$main.doInvoke(main.clj:427)
at clojure.lang.RestFn.invoke(RestFn.java:457)
at clojure.lang.Var.invoke(Var.java:427)
at clojure.lang.AFn.applyToHelper(AFn.java:172)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.main.main(main.java:37)
Caused by: java.lang.ClassNotFoundException: org/apache/hadoop/hbase/client/Put
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
at clojure.lang.Compiler$StaticMethodExpr.eval(Compiler.java:1576)
... 52 more
It should probably be
:with-timestamp time [:column :cf :cq :column :cf2 :cq2 :columns :cf [:cq1 :cq2 :cq3 ...]
.
Similarly,
:all-versions [:column :cf :cq :column :cf2 :cq2 :columns :cf [:cq3 :cq4 :cq5]]
The project is still on Clojure 1.2.0.
Thanks for merging in my recent pull request.
Can I make one suggestion regarding the change you made, which you can feel free to ignore? If you're going to accept a map argument, consider instead the destructuring form {:keys [] :as config-map} (no keys specified in key vector).
See Library Coding Standards http://dev.clojure.org/display/design/Library+Coding+Standards "Callers should not have to wrap optional named arguments in a map literal"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.