asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mhub...@apache.org
Subject asterixdb git commit: ASTERIXDB-1363: Fix NPE on bulkload failure
Date Fri, 29 Jul 2016 09:52:49 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master 5dc73edd3 -> 3f83b2c5c


ASTERIXDB-1363: Fix NPE on bulkload failure

Change-Id: Ic1626baa63371834cc2abbe30366df506d817da6
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1033
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: abdullah alamoudi <bamousaa@gmail.com>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/3f83b2c5
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/3f83b2c5
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/3f83b2c5

Branch: refs/heads/master
Commit: 3f83b2c5cb2526b47e29d1ea8871ed454e8a5509
Parents: 5dc73ed
Author: Murtadha Hubail <mhubail@uci.edu>
Authored: Fri Jul 29 11:09:09 2016 +0300
Committer: Murtadha Hubail <hubailmor@gmail.com>
Committed: Fri Jul 29 02:52:05 2016 -0700

----------------------------------------------------------------------
 .../load_non-empty_index.1.ddl.aql              | 33 ++++++++++++++++++++
 .../load_non-empty_index.2.update.aql           | 32 +++++++++++++++++++
 .../src/test/resources/runtimets/testsuite.xml  |  6 ++++
 .../IndexBulkLoadOperatorNodePushable.java      |  7 +++--
 4 files changed, 76 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/3f83b2c5/asterixdb/asterix-app/src/test/resources/runtimets/queries/load/load_non-empty_index/load_non-empty_index.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/load/load_non-empty_index/load_non-empty_index.1.ddl.aql
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/load/load_non-empty_index/load_non-empty_index.1.ddl.aql
new file mode 100644
index 0000000..963e105
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/load/load_non-empty_index/load_non-empty_index.1.ddl.aql
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+ * Description  : Bulkload non-empty index.
+ * Expected Res : Failure
+ * Date         : 29 July 2016
+ */
+drop dataverse OpenTinySocial if exists;
+create dataverse OpenTinySocial;
+use dataverse OpenTinySocial;
+
+create type FacebookMessageType as {
+  message-id: int64
+};
+
+create dataset FacebookMessages(FacebookMessageType)
+primary key message-id;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/3f83b2c5/asterixdb/asterix-app/src/test/resources/runtimets/queries/load/load_non-empty_index/load_non-empty_index.2.update.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/load/load_non-empty_index/load_non-empty_index.2.update.aql
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/load/load_non-empty_index/load_non-empty_index.2.update.aql
new file mode 100644
index 0000000..21db981
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/load/load_non-empty_index/load_non-empty_index.2.update.aql
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+ * Description  : Bulkload non-empty index.
+ * Expected Res : Failure
+ * Date         : 29 July 2016
+ */
+use dataverse OpenTinySocial;
+
+load dataset FacebookMessages
+using localfs
+(("path"="asterix_nc1://data/tinysocial/fbm.adm"),("format"="adm"));
+
+load dataset FacebookMessages
+using localfs
+(("path"="asterix_nc1://data/tinysocial/fbm.adm"),("format"="adm"));
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/3f83b2c5/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml
index b675ece..0553fba 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -6380,6 +6380,12 @@
   </test-group>
   <test-group name="load">
     <test-case FilePath="load">
+      <compilation-unit name="load_non-empty_index">
+        <output-dir compare="Text">load_non-empty_index</output-dir>
+        <expected-error>Cannot load an index that is not empty</expected-error>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="load">
       <compilation-unit name="dataset-with-meta">
         <output-dir compare="Text">dataset-with-meta</output-dir>
         <expected-error>load dataset is not supported on Datasets with Meta records</expected-error>

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/3f83b2c5/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/dataflow/IndexBulkLoadOperatorNodePushable.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/dataflow/IndexBulkLoadOperatorNodePushable.java
b/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/dataflow/IndexBulkLoadOperatorNodePushable.java
index 36b46a7..56cad89 100644
--- a/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/dataflow/IndexBulkLoadOperatorNodePushable.java
+++ b/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/dataflow/IndexBulkLoadOperatorNodePushable.java
@@ -97,7 +97,10 @@ public class IndexBulkLoadOperatorNodePushable extends AbstractUnaryInputUnaryOu
     @Override
     public void close() throws HyracksDataException {
         try {
-            bulkLoader.end();
+            // bulkloader can be null if an exception is thrown before it is initialized.
+            if (bulkLoader != null) {
+                bulkLoader.end();
+            }
         } catch (Throwable th) {
             throw new HyracksDataException(th);
         } finally {
@@ -123,4 +126,4 @@ public class IndexBulkLoadOperatorNodePushable extends AbstractUnaryInputUnaryOu
             writer.fail();
         }
     }
-}
+}
\ No newline at end of file


Mime
View raw message