2。hbase CRUD--Read(query) operations

read



 

 

 

 

Note:

-Gets will be converted to scan per Get in RS

-scan is needless to use offset for retrieving ranged rows.this is different from common RMDBS.and this is implemented by RS used KeyValueHeap to mark scan position

-in hbase,there is a param called "hbase.client.scanner.max.result.size" for limit the result size(bytes) from RS,so RS will use both this param and caching to limit the rows to be returned.

-as Batch #3 diagramed above ,client will use the endkey of batch #2 as startkey to relocate next region,

so it's transparently implement scan cross region for client .

-as u see,hbase Scan is probed to regions continuously(NOT concurrently),so the returned results ordered by rowkeys in ascend.once the results size is satisfied requirement,scan will be stoped there.

-I dont know why the scannerId is generated by random,and never check for duplication in regionserver!!

if you know ,give me a clue please~~ ( as 2。hbase CRUD--Lease in hbase ,there is bug :)

protected long addScanner(RegionScanner s) throws LeaseStillHeldException {
    long scannerId = -1L;
    scannerId = rand.nextLong();
    String scannerName = String.valueOf(scannerId);
    scanners.put(scannerName, s);   
    this.leases.createLease(scannerName, new ScannerListener(scannerName));
    return scannerId;
  }

ref:

2。hbase CRUD--Read(query) operations(server side) 

read



 

 

 

 

Note:

-Gets will be converted to scan per Get in RS

-scan is needless to use offset for retrieving ranged rows.this is different from common RMDBS.and this is implemented by RS used KeyValueHeap to mark scan position

-in hbase,there is a param called "hbase.client.scanner.max.result.size" for limit the result size(bytes) from RS,so RS will use both this param and caching to limit the rows to be returned.

-as Batch #3 diagramed above ,client will use the endkey of batch #2 as startkey to relocate next region,

so it's transparently implement scan cross region for client .

-as u see,hbase Scan is probed to regions continuously(NOT concurrently),so the returned results ordered by rowkeys in ascend.once the results size is satisfied requirement,scan will be stoped there.

-I dont know why the scannerId is generated by random,and never check for duplication in regionserver!!

if you know ,give me a clue please~~ ( as 2。hbase CRUD--Lease in hbase ,there is bug :)

protected long addScanner(RegionScanner s) throws LeaseStillHeldException {
    long scannerId = -1L;
    scannerId = rand.nextLong();
    String scannerName = String.valueOf(scannerId);
    scanners.put(scannerName, s);   
    this.leases.createLease(scannerName, new ScannerListener(scannerName));
    return scannerId;
  }

ref:

2。hbase CRUD--Read(query) operations(server side) 

猜你喜欢

转载自leibnitz.iteye.com/blog/1925061