You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by mh...@apache.org on 2015/09/30 06:03:33 UTC

incubator-asterixdb-hyracks git commit: ASTERIXDB-1002: Fix exception handling in EmptyTupleSourceRuntimeFactory

Repository: incubator-asterixdb-hyracks
Updated Branches:
  refs/heads/master 9295be1ab -> 9c569a23d


ASTERIXDB-1002: Fix exception handling in EmptyTupleSourceRuntimeFactory

Change-Id: Ibc9da24ceca87c6a8ec4bae16a0579312c27b668
Reviewed-on: https://asterix-gerrit.ics.uci.edu/416
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <ti...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/commit/9c569a23
Tree: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/tree/9c569a23
Diff: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/diff/9c569a23

Branch: refs/heads/master
Commit: 9c569a23dae62cd5b5c8e6ff14be05f8c7c8276d
Parents: 9295be1
Author: Murtadha Hubail <mh...@uci.edu>
Authored: Tue Sep 29 17:51:11 2015 -0700
Committer: Murtadha Hubail <hu...@gmail.com>
Committed: Tue Sep 29 20:59:09 2015 -0700

----------------------------------------------------------------------
 .../operators/std/EmptyTupleSourceRuntimeFactory.java   | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9c569a23/algebricks/algebricks-runtime/src/main/java/org/apache/hyracks/algebricks/runtime/operators/std/EmptyTupleSourceRuntimeFactory.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-runtime/src/main/java/org/apache/hyracks/algebricks/runtime/operators/std/EmptyTupleSourceRuntimeFactory.java b/algebricks/algebricks-runtime/src/main/java/org/apache/hyracks/algebricks/runtime/operators/std/EmptyTupleSourceRuntimeFactory.java
index b5d717a..5b66736 100644
--- a/algebricks/algebricks-runtime/src/main/java/org/apache/hyracks/algebricks/runtime/operators/std/EmptyTupleSourceRuntimeFactory.java
+++ b/algebricks/algebricks-runtime/src/main/java/org/apache/hyracks/algebricks/runtime/operators/std/EmptyTupleSourceRuntimeFactory.java
@@ -49,13 +49,15 @@ public class EmptyTupleSourceRuntimeFactory implements IPushRuntimeFactory {
             @Override
             public void open() throws HyracksDataException {
                 writer.open();
-                if (!appender.append(tb.getFieldEndOffsets(), tb.getByteArray(), 0, tb.getSize())) {
-                    throw new IllegalStateException();
+                try {
+                    if (!appender.append(tb.getFieldEndOffsets(), tb.getByteArray(), 0, tb.getSize())) {
+                        throw new IllegalStateException();
+                    }
+                    appender.flush(writer, true);
+                } finally {
+                    writer.close();
                 }
-                appender.flush(writer, true);
-                writer.close();
             }
         };
     }
-
 }