MCPcopy Create free account
hub / github.com/OpenTSDB/asynchbase / continueScanOnNextRegion

Method continueScanOnNextRegion

src/Scanner.java:986–1019  ·  view source on GitHub ↗

Continues scanning on the next region. This method is called when we tried to get more rows but we reached the end of the current region and need to move on to the next region. This method closes the scanner on the current region, updates the start key of this scanner and resumes scanning on

()

Source from the content-addressed store, hash-verified

984 * @return The deferred results from the next region.
985 */
986 private Deferred<ArrayList<ArrayList<KeyValue>>> continueScanOnNextRegion() {
987 // Copy those into local variables so we can still refer to them in the
988 // "closure" below even after we've changed them.
989 final long old_scanner_id = scanner_id;
990 final RegionInfo old_region = region;
991 if(LOG.isDebugEnabled()) {
992 LOG.debug("Scanner " + Bytes.hex(old_scanner_id) + " done scanning "
993 + old_region);
994 }
995 client.closeScanner(this).addCallback(new Callback<Object, Object>() {
996 public Object call(final Object arg) {
997 if(LOG.isDebugEnabled()) {
998 LOG.debug("Scanner " + Bytes.hex(old_scanner_id) + " closed on "
999 + old_region);
1000 }
1001 return arg;
1002 }
1003
1004 public String toString() {
1005 return "scanner moved";
1006 }
1007 });
1008 // Continue scanning from the next region's start key
1009 // Dependent on direction of scan
1010 if (is_reversed){
1011 start_key = RegionInfo.startKeyFromRegionName(region.name());
1012 } else{
1013 start_key = region.stopKey();
1014 }
1015
1016 scanner_id = 0xDEAD000AA000DEADL; // Make debugging easier.
1017 invalidate();
1018 return nextRows();
1019 }
1020
1021 public String toString() {
1022 final String region = this.region == null ? "null"

Callers 1

scanFinishedMethod · 0.95

Calls 7

hexMethod · 0.95
invalidateMethod · 0.95
nextRowsMethod · 0.95
closeScannerMethod · 0.80
nameMethod · 0.45
stopKeyMethod · 0.45

Tested by

no test coverage detected