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:
http://wiki.apache.org/hadoop/Hbase/FAQ

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));
  table.commit(update);
  // Now fetch the content just added
- byte data[] = table.get(row, new Text("content:"));
+ byte data[] = table.get(row, "content:");
  // Delete the table.
  admin.deleteTable(desc.getName());}}}
  

Mime
View raw message