greglu / hbase-stargate Goto Github PK
View Code? Open in Web Editor NEWRuby client for HBase's Stargate web service
License: MIT License
Ruby client for HBase's Stargate web service
License: MIT License
Trying to gem build the 1.6.0 branch and I get this:
] gem build hbase-stargate.gemspec
ERROR: While executing gem ... (Gem::InvalidSpecificationException)
["lib/stargate/model/region_descriptor.rb", "spec/hbase-stargate/model/region_descriptor_spec.rb"] are not files
Using Master branch, I'm trying to create a table, and I get:
irb(main):008:0> table = client.create_table("table2", 'data')
Stargate::TableFailCreateError: 503 "Service Unavailable"
from /usr/local/lib/ruby/gems/1.8/gems/hbase-stargate-1.5.1/lib/stargate/operation/table_operation.rb:43:in `create_table'
from (irb):8
irb(main):009:0> exit
confirmed that tables can be created in the console.
It would be great if the ruby gem could support multiple row requests at once. http://wiki.apache.org/hadoop/Hbase/Stargate#A3
/home/krina/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.1/lib/bundler/vendor/postit/lib/postit/environment.rb
/home/krina/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/gem-wrappers-1.2.7/lib/gem-wrappers/environment.rb
/home/krina/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rvm-1.11.3.9/lib/rvm/environment.rb
Hi I have problems with Stargate, it always returning XML responses, no matter what you specified in the 'Accept' property of header?
Tried HBase 0.20.4, 0.20.6, 0.89.20100726 - all of them are returning XML and consequently hbase-stargate doesn't work (because it expect json).
Do you have such problems?
The gem defines an alter_table operation, but it appears to be unfinished. It calls an undefined method 'construct_xml_stream'.
i have code similiar to the following:
scanner = client.open_scanner("table", {:columns => "a", :batch => 10, :limit => 4})
rows = client.get_rows(scanner, 10)
rows.each do |row|
puts row.name + " " + row.columns.to_s
end
when column-family 'a' has 4 columns this should return results like:
row1 col a:1 col a:2 col a:3 col a:4
row2 col a:1 col a:2 col a:3 col a:4
row3 col a:1 col a:2 col a:3 col a:4
row4 col a:1 col a:2 col a:3 col a:4
but what i get is :
row1 col a:1 col a:2 col a:3 col a:4
row2 col a:1 col a:2 col a:3 col a:4
row3 col a:1 col a:2
row3 col a:3 col a:4
row4 col a:1 col a:2 col a:3 col a:4
however, when I change :batch from 10 to 100 it works.
It seams that rows are not correctly assembled when they are split because of the batch-size
Trying to 'gem install hbase-stargate'
Ruby -v = 1.9.2
I get the following:
[root@vm-swtg-um-002 ~]# gem install hbase-stargate
Building native extensions. This could take a while...
ERROR: Error installing hbase-stargate:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for curl-config... yes
checking for rb_thread_blocking_region()... yes
creating Makefile
make
gcc -I. -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -DUSE_TBR -DHAVE_RB_THREAD_BLOCKING_REGION -DHAVE_TBR -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -pedantic -Wall -o membuffer.o -c membuffer.c
gcc -I. -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -DUSE_TBR -DHAVE_RB_THREAD_BLOCKING_REGION -DHAVE_TBR -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -pedantic -Wall -o session_ext.o -c session_ext.c
session_ext.c: In function ‘Init_session_ext’:
session_ext.c:727: error: ‘CURLPROXY_HTTP_1_0’ undeclared (first use in this function)
session_ext.c:727: error: (Each undeclared identifier is reported only once
session_ext.c:727: error: for each function it appears in.)
session_ext.c:730: error: ‘CURLPROXY_SOCKS4A’ undeclared (first use in this function)
session_ext.c:731: error: ‘CURLPROXY_SOCKS5_HOSTNAME’ undeclared (first use in this function)
make: *** [session_ext.o] Error 1
how to convert fetched data from hbase (in RoR) using Stargate in to xml
ScannerOperation.get_rows loads the entire result into memory. I would like to work with ranges that are larger than memory; I could do this if there were a ScannerOperation.get_each_row method. It should load batches, yielding rows one-by-one to the block.
If you just use the client and let it go out of scope, it can leave many connections open and in a busy site saturate the server with open connections.
It would be good to have a setting that is more aggressive about closing the http connections when they are done.
Here is a simple test code,
require 'rubygems'
require 'stargate'
client = Stargate::Client.new("http://localhost:8080") # this url is the default for stargate.
client.delete_table('users') # delete 'users' table
table = client.create_table('users', 'habbit') # create a table whose column_family is habbit
row = client.create_row('users', 'sishen', 2, {:name => 'habbit:football', :value => 'i like football'}) # create the row 'sishen' with the data in the table 'users'
row = client.create_row('users', 'sishen', 1, {:name => 'habbit:football', :value => 'i like basketball'}) # create the row 'sishen' with the data in the table 'users'
there should be two record with the same row key and different timestamp, right? But i only get one,
hbase(main):030:0> scan 'users'
ROW COLUMN+CELL
sishen column=habbit:football, timestamp=2, value=i like football
1 row(s) in 1.0410 seconds
Is it a bug?
In RubyGems the latest version listed is 1.6.1 but I can't find this version in the repository. Where can it be accessed to?
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.