beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject [1/2] beam git commit: Check that bigtableWriter is non-null before calling close().
Date Tue, 07 Nov 2017 05:26:18 GMT
Repository: beam
Updated Branches:
  refs/heads/master 3dfcb4447 -> 269bf8946


Check that bigtableWriter is non-null before calling close().

TearDown can be called before a bundle, so it's necessary to
check that the writer is uninitialized.


Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/255b6159
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/255b6159
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/255b6159

Branch: refs/heads/master
Commit: 255b61595bce896cfd25a815fa5b03377bd0bce2
Parents: 3dfcb44
Author: Bill Neubauer <wcn@google.com>
Authored: Mon Nov 6 14:21:18 2017 -0800
Committer: Kenneth Knowles <kenn@apache.org>
Committed: Mon Nov 6 19:16:04 2017 -0800

----------------------------------------------------------------------
 .../java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/255b6159/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java
----------------------------------------------------------------------
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 ba6c0b6..29dc269 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
@@ -639,8 +639,10 @@ public class BigtableIO {
 
       @Teardown
       public void tearDown() throws Exception {
-        bigtableWriter.close();
-        bigtableWriter = null;
+        if (bigtableWriter != null) {
+          bigtableWriter.close();
+          bigtableWriter = null;
+        }
       }
 
       @Override


Mime
View raw message