[
https://issues.apache.org/jira/browse/BEAM-3156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16270095#comment-16270095
]
ASF GitHub Bot commented on BEAM-3156:
--------------------------------------
chamikaramj closed pull request #4095: [BEAM-3156] Fix BigTableIO to use
non-deprecated Futures.addCallback function
URL: https://github.com/apache/beam/pull/4095
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java
b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java
index 29dc269f7fd..cb40acbe447 100644
---
a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java
+++
b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java
@@ -36,6 +36,7 @@
import com.google.common.collect.Lists;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.MoreExecutors;
import com.google.protobuf.ByteString;
import java.io.IOException;
import java.util.Collections;
@@ -626,7 +627,9 @@ public void startBundle(StartBundleContext c) throws
IOException {
public void processElement(ProcessContext c) throws Exception {
checkForFailures();
Futures.addCallback(
- bigtableWriter.writeRecord(c.element()), new
WriteExceptionCallback(c.element()));
+ bigtableWriter.writeRecord(c.element()),
+ new WriteExceptionCallback(c.element()),
+ MoreExecutors.directExecutor());
++recordsWritten;
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Use non-deprecated Futures.addCallback function.
> ------------------------------------------------
>
> Key: BEAM-3156
> URL: https://issues.apache.org/jira/browse/BEAM-3156
> Project: Beam
> Issue Type: Improvement
> Components: sdk-java-gcp
> Reporter: Ryan Niemocienski
> Assignee: Chamikara Jayalath
> Priority: Minor
>
> addCallback(ListenableFuture, FutureCallback) is in the process of being
> deprecated in favor of addCallback(ListenableFuture, FutureCallback,
> Executor). Currently BigtableIO uses the former function call; switch it to
> the second one.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)