hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Hadoop Wiki] Trivial Update of "Hbase/FAQ" by stack
Date Tue, 15 Jul 2008 03:58:03 GMT
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:

The comment on the change is:
Fix up of sample code

  // New table should be in list of returned tables.
  // Or you could call admin.exists();
- HTable table = new HTable(conf, new Text("test"));
+ HTable table = new HTable(conf, "test");
  // Add content to 'column:' on a row named 'row_x'
- Text row = new Text("row_x");
+ String row = "row_x";
  BatchUpdate update = new BatchUpdate(row);
+ update.put("content:", Bytes.toBytes("some content");
- update.put(new Text("content:"),
-   "some content".getBytes(HConstants.UTF8_ENCODING));
  // Now fetch the content just added
- byte data[] = table.get(row, new Text("content:"));
+ byte data[] = table.get(row, "content:");
  // Delete the table.

View raw message