Package-private access point for Scanners to scan more rows. @param scanner The scanner to use. @return A deferred row.
(final Scanner scanner)
| 1588 | * @return A deferred row. |
| 1589 | */ |
| 1590 | Deferred<Object> scanNextRows(final Scanner scanner) { |
| 1591 | final RegionInfo region = scanner.currentRegion(); |
| 1592 | final RegionClient client = clientFor(region); |
| 1593 | if (client == null) { |
| 1594 | // Oops, we no longer know anything about this client or region. Our |
| 1595 | // cache was probably invalidated while the client was scanning. This |
| 1596 | // means that we lost the connection to that RegionServer, so we have to |
| 1597 | // re-open this scanner if we wanna keep scanning. |
| 1598 | scanner.invalidate(); // Invalidate the scanner so that ... |
| 1599 | @SuppressWarnings("unchecked") |
| 1600 | final Deferred<Object> d = (Deferred) scanner.nextRows(); |
| 1601 | return d; // ... this will re-open it ______.^ |
| 1602 | } |
| 1603 | num_scans.increment(); |
| 1604 | final HBaseRpc next_request = scanner.getNextRowsRequest(); |
| 1605 | final Deferred<Object> d = next_request.getDeferred(); |
| 1606 | client.sendRpc(next_request); |
| 1607 | return d; |
| 1608 | } |
| 1609 | |
| 1610 | /** |
| 1611 | * Package-private access point for {@link Scanner}s to close themselves. |
no test coverage detected