Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change notification.
The following page has been changed by stack:
http://wiki.apache.org/hadoop/Hbase/JRuby
The comment on the change is:
A bit of script that works in TRUNK
------------------------------------------------------------------------------
- == Accessing HBase trunk from JRuby 1.1.1 ==
+ = Accessing HBase trunk from JRuby 1.1.x =
This page describes the process of connecting to HBase from JRuby. The code mostly follows
the [http://wiki.apache.org/hadoop/Hbase/FAQ#1 Can someone give an example of basic API-usage
going against hbase?] example listed in the HBase FAQ.
@@ -83, +83 @@
admin.deleteTable(desc.getName)
}}}
+ == Scanning Script ==
+ Here's a bit of script to return rows between the start of table TestTable and an end row
of '0000000003':
+
+ {{{c = HBaseConfiguration.new()
+ t = HTable.new(c, "TestTable")
+ columns = ["info:"].to_java(java.lang.String)
+ s = t.getScanner(columns, "", "0000000003", HConstants::LATEST_TIMESTAMP).iterator()
+ while s.hasNext() do
+ puts String.from_java_bytes s.next().getRow()
+ end}}}
+
+ Here's how to run it:
+
+ {{{$ ./bin/hbase shell /tmp/scan.rb}}}
+
+ Only works for TRUNK as of 06/05/2008.
+
|