diegomez17 commented on code in PR #16939:
URL: https://github.com/apache/beam/pull/16939#discussion_r872519648
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableServiceImpl.java:
##########
@@ -362,42 +346,46 @@ public void onError(Throwable e) {
public void onCompleted() {
ReadRowsRequest nextNextRequest = null;
- if (byteLimitReached || rows.size() == segmentSize) {
+ // When requested rows < limit, the current request will
be the last
+ if (byteLimitReached || rows.size() ==
nextRequest.getRowsLimit()) {
nextNextRequest =
truncateRequest(nextRequest, rows.get(rows.size()
- 1).getKey());
}
-
f.set(new UpstreamResults(rows, nextNextRequest));
}
});
- atomic.set(handler);
+ atomicScanHandler.set(handler);
return f;
}
- void waitReadRowsFuture() throws IOException {
+ private void waitReadRowsFuture() throws IOException {
try {
UpstreamResults r = future.get();
buffer.addAll(r.rows);
nextRequest = r.nextRequest;
future = null;
serviceCallMetric.call("ok");
- } catch (StatusRuntimeException e) {
- serviceCallMetric.call(e.getStatus().getCode().value());
- throw e;
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IOException(e);
} catch (ExecutionException e) {
- throw new IOException(e);
+ throw new IOException(e.getCause());
+ }
+ catch (Exception e) {
+ if (e instanceof InterruptedException) {
Review Comment:
I meant to delete the catch (Exception e) for the catches above. Is there a
need for checking e.getCause()?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]