Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C2EE2200B21 for ; Fri, 10 Jun 2016 18:49:27 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C1753160A38; Fri, 10 Jun 2016 16:49:27 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BB00C160A15 for ; Fri, 10 Jun 2016 18:49:26 +0200 (CEST) Received: (qmail 1885 invoked by uid 500); 10 Jun 2016 16:49:25 -0000 Mailing-List: contact commits-help@asterixdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@asterixdb.apache.org Delivered-To: mailing list commits@asterixdb.apache.org Received: (qmail 1876 invoked by uid 99); 10 Jun 2016 16:49:25 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jun 2016 16:49:25 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CC234DFDEF; Fri, 10 Jun 2016 16:49:25 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: amoudi@apache.org To: commits@asterixdb.apache.org Message-Id: <0c03e83c56024e1ea2aabd355aa8b65b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: asterixdb git commit: ASTERIXDB-1477 Fix Drop Feed If Not Exists Date: Fri, 10 Jun 2016 16:49:25 +0000 (UTC) archived-at: Fri, 10 Jun 2016 16:49:27 -0000 Repository: asterixdb Updated Branches: refs/heads/master e0ae67bec -> 18d958044 ASTERIXDB-1477 Fix Drop Feed If Not Exists Change-Id: I9ce76ff5fd6611df5060a1de77742aba9d146ab5 Reviewed-on: https://asterix-gerrit.ics.uci.edu/918 Tested-by: Jenkins Reviewed-by: abdullah alamoudi Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/18d95804 Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/18d95804 Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/18d95804 Branch: refs/heads/master Commit: 18d958044dae45ea62126fcf53c432ace5efff83 Parents: e0ae67b Author: Abdullah Alamoudi Authored: Fri Jun 10 12:36:53 2016 +0300 Committer: abdullah alamoudi Committed: Fri Jun 10 09:46:31 2016 -0700 ---------------------------------------------------------------------- .../asterix/aql/translator/QueryTranslator.java | 7 ++++- .../drop-nonexistent-feed.1.ddl.aql | 28 ++++++++++++++++++++ .../feed-with-external-function.6.ddl.aql | 19 ------------- .../feed-with-external-function.6.lib.aql | 19 +++++++++++++ .../feed-with-external-function.7.ddl.aql | 19 +++++++++++++ .../feed-with-external-function.7.lib.aql | 19 ------------- .../src/test/resources/runtimets/testsuite.xml | 8 +++--- 7 files changed, 77 insertions(+), 42 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/asterixdb/blob/18d95804/asterixdb/asterix-app/src/main/java/org/apache/asterix/aql/translator/QueryTranslator.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/aql/translator/QueryTranslator.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/aql/translator/QueryTranslator.java index 7a7aa40..6c5f70a 100644 --- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/aql/translator/QueryTranslator.java +++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/aql/translator/QueryTranslator.java @@ -1379,7 +1379,8 @@ public class QueryTranslator extends AbstractLangTranslator { } } - Map> disconnectJobList = new HashMap>(); + Map> disconnectJobList = + new HashMap>(); if (ds.getDatasetType() == DatasetType.INTERNAL) { // prepare job spec(s) that would disconnect any active feeds involving the dataset. List feedConnections = FeedLifecycleListener.INSTANCE.getActiveFeedConnections(null); @@ -2085,6 +2086,8 @@ public class QueryTranslator extends AbstractLangTranslator { if (!stmtFeedDrop.getIfExists()) { throw new AlgebricksException("There is no feed with this name " + feedName + "."); } + MetadataManager.INSTANCE.commitTransaction(mdTxnCtx); + return; } FeedId feedId = new FeedId(dataverseName, feedName); @@ -2133,6 +2136,8 @@ public class QueryTranslator extends AbstractLangTranslator { if (!stmtFeedPolicyDrop.getIfExists()) { throw new AlgebricksException("Unknown policy " + policyName + " in dataverse " + dataverseName); } + MetadataManager.INSTANCE.commitTransaction(mdTxnCtx); + return; } MetadataManager.INSTANCE.dropFeedPolicy(mdTxnCtx, dataverseName, policyName); MetadataManager.INSTANCE.commitTransaction(mdTxnCtx); http://git-wip-us.apache.org/repos/asf/asterixdb/blob/18d95804/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/drop-nonexistent-feed/drop-nonexistent-feed.1.ddl.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/drop-nonexistent-feed/drop-nonexistent-feed.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/drop-nonexistent-feed/drop-nonexistent-feed.1.ddl.aql new file mode 100644 index 0000000..5ab70df --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/drop-nonexistent-feed/drop-nonexistent-feed.1.ddl.aql @@ -0,0 +1,28 @@ +/* + * 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 : Drop a Non existent feed + * Expected Res : Success + * Date : 10th Jun 2016 + */ +drop dataverse experiments if exists; +create dataverse experiments; +use dataverse experiments; + +drop feed TweetFeed if exists; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/asterixdb/blob/18d95804/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-function/feed-with-external-function.6.ddl.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-function/feed-with-external-function.6.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-function/feed-with-external-function.6.ddl.aql deleted file mode 100644 index 2a7acef..0000000 --- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-function/feed-with-external-function.6.ddl.aql +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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. - */ -drop dataverse externallibtest if exists; http://git-wip-us.apache.org/repos/asf/asterixdb/blob/18d95804/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-function/feed-with-external-function.6.lib.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-function/feed-with-external-function.6.lib.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-function/feed-with-external-function.6.lib.aql new file mode 100644 index 0000000..86af80f --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-function/feed-with-external-function.6.lib.aql @@ -0,0 +1,19 @@ +/* + * 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. + */ +uninstall externallibtest testlib \ No newline at end of file http://git-wip-us.apache.org/repos/asf/asterixdb/blob/18d95804/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-function/feed-with-external-function.7.ddl.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-function/feed-with-external-function.7.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-function/feed-with-external-function.7.ddl.aql new file mode 100644 index 0000000..2a7acef --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-function/feed-with-external-function.7.ddl.aql @@ -0,0 +1,19 @@ +/* + * 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. + */ +drop dataverse externallibtest if exists; http://git-wip-us.apache.org/repos/asf/asterixdb/blob/18d95804/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-function/feed-with-external-function.7.lib.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-function/feed-with-external-function.7.lib.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-function/feed-with-external-function.7.lib.aql deleted file mode 100644 index 86af80f..0000000 --- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-function/feed-with-external-function.7.lib.aql +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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. - */ -uninstall externallibtest testlib \ No newline at end of file http://git-wip-us.apache.org/repos/asf/asterixdb/blob/18d95804/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 3f5ef09..13acfc9 100644 --- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml +++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml @@ -92,6 +92,11 @@ + + drop-nonexistent-feed + + + feed-with-multiple-indexes @@ -185,13 +190,11 @@ feeds_09 - feeds_10 - feeds_11 @@ -202,7 +205,6 @@ feeds_12 - issue_230_feeds