Changes between Version 3 and Version 4 of table_example2


Ignore:
Timestamp:
09/14/2012 05:38:09 PM (14 years ago)
Author:
liaojiaohe
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • table_example2

    v3 v4  
    77"s" + show_id[[BR]] 
    88"a" + album_id[[BR]] 
    9 "m" + name 
     9"m" + name[[BR]] 
    1010 
     11 
     12在一个ROW里面根据字段名查询可以使用Column的各种Filter[[BR]] 
     13 
     14{{{ 
     15HTable t = ...; 
     16Scan s = ...; 
     17s.setStartRow("pets"); 
     18s.setStopRow("pets"); 
     19// get all columns for my pet "fluffy".  
     20Filter f = new ColumnRangeFilter(Bytes.toBytes("fluffy"), true, 
     21                                 Bytes.toBytes("fluffz"), false); 
     22s.setFilter(f); 
     23s.setBatch(20); // avoid getting all columns for the HBase row  
     24ResultScanner rs = t.getScanner(s); 
     25for (Result r = rs.next(); r != null; r = rs.next()) { 
     26  // r will now have all HBase columns that start with "fluffy", 
     27  // which would represent a single row 
     28  for (KeyValue kv : r.raw()) { 
     29    // each kv represent - the latest version of - a column 
     30  } 
     31} 
     32}}} 
    1133 
    1234----