Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Examples for reading and writing rows

  • Loading branch information...
commit c4f0ef10b887bcaab85bac3ee0c84b438f938d66 1 parent 9baf895
@alindeman alindeman authored
Showing with 19 additions and 0 deletions.
  1. +19 −0 README.md
View
19 README.md
@@ -64,6 +64,25 @@ client = HBase::Client.new(protocol)
puts client.getTableNames
```
+## Writing Rows
+
+```ruby
+# Assuming a table "mytable" and a column family "c"
+client.mutateRow("mytable", "abc123", [HBase::Mutation.new(column: "c:foo", value: "bar")])
+```
+
+## Reading Rows
+
+```ruby
+# Assuming a table "mytable" and a column family "c"
+results = client.getRow("mytable", "abc123")
+if result = results.first
+ result.columns.each do |key, cell|
+ puts "#{key}: #{cell.value}"
+ end
+end
+```
+
## API Reference
* [Hbase/ThriftApi](http://wiki.apache.org/hadoop/Hbase/ThriftApi)
Please sign in to comment.
Something went wrong with that request. Please try again.