hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From steven zhuang <steven.zhuang.1...@gmail.com>
Subject multiple scanners on same table/region
Date Fri, 23 Apr 2010 03:10:52 GMT
          sorry I start another thread here.  This mail is actually answer
to a previous thread "multiple scanners on same table will cause problem?
Scan results change among different tries.".
          the mail system kept saying that I am spamming, now it seems that
it's right! :)

here is my reply to people in that thread:

      I don't know if there is a limit on reads to a single row/region in
HBase, but if there is, I might have exceeded that limit.   :(
      in my case, there are hundreds of rows, with dozens of kilos of cells
in a row(a 256 MB region may contain 10- rows). for each row, I started a
thread on each CF, there are 8 of them, so there might be dozens of scanners
on the same region.
      and, to Tim, I could not see your attached mail, my test code is
pasted below, it just iterate on the rows and column families, output all
the cells.

  private void doScan() throws Exception {
if (null == CopyOfTestTTT234.table) {
Scan s = new Scan();
s.setCaching(CopyOfTestTTT234.ROWCACHING);  //it's 1 here.
ResultScanner scanner = CopyOfTestTTT234.table.getScanner(s);
while (true) {
Result row = scanner.next();
if(null==row) break;
String rowKey = new String(row.getRow());
NavigableMap<byte[], NavigableMap<byte[], byte[]>> fm = row
while (fm.size() > 0) {
Entry<byte[], NavigableMap<byte[], byte[]>> ee = fm
String fName = new String(ee.getKey());
NavigableMap<byte[], byte[]> ff = ee.getValue();
while (ff.size() > 0) {
Entry<byte[], byte[]> cell = ff.pollFirstEntry();
String key = new String(cell.getKey());
String val = new String(cell.getValue());
System.out.println(Thread.currentThread().hashCode() + "\t"
+ rowKey + "\t" + fName + "\t" + key + "\t" + val);

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message