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

Method closeScanner

src/HBaseClient.java:1616–1631  ·  view source on GitHub ↗

Package-private access point for Scanners to close themselves. @param scanner The scanner to close. @return A deferred object that indicates the completion of the request. The Object has not special meaning and can be null.

(final Scanner scanner)

Source from the content-addressed store, hash-verified

1614 * The {@link Object} has not special meaning and can be {@code null}.
1615 */
1616 Deferred<Object> closeScanner(final Scanner scanner) {
1617 final RegionInfo region = scanner.currentRegion();
1618 final RegionClient client = clientFor(region);
1619 if (client == null) {
1620 // Oops, we no longer know anything about this client or region. Our
1621 // cache was probably invalidated while the client was scanning. So
1622 // we can't close this scanner properly.
1623 LOG.warn("Cannot close " + scanner + " properly, no connection open for "
1624 + Bytes.pretty(region == null ? null : region.name()));
1625 return Deferred.fromResult(null);
1626 }
1627 final HBaseRpc close_request = scanner.getCloseRequest();
1628 final Deferred<Object> d = close_request.getDeferred();
1629 client.sendRpc(close_request);
1630 return d;
1631 }
1632
1633 /**
1634 * Atomically and durably increments a value in HBase.

Callers 2

closeMethod · 0.80

Calls 7

clientForMethod · 0.95
prettyMethod · 0.95
nameMethod · 0.95
getDeferredMethod · 0.95
sendRpcMethod · 0.95
currentRegionMethod · 0.80
getCloseRequestMethod · 0.80

Tested by

no test coverage detected