You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by sj...@apache.org on 2016/09/09 20:54:14 UTC
[12/15] asterixdb-bad git commit: Fixed structure
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/asterix-opt/src/test/resources/runtimets/results/channels/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.1.adm
----------------------------------------------------------------------
diff --git a/asterix-opt/src/test/resources/runtimets/results/channels/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.1.adm b/asterix-opt/src/test/resources/runtimets/results/channels/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.1.adm
new file mode 100644
index 0000000..2bec6d3
--- /dev/null
+++ b/asterix-opt/src/test/resources/runtimets/results/channels/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.1.adm
@@ -0,0 +1,4 @@
+[ "Live"
+, "Long"
+, "Prosper"
+ ]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/data/data1/current/BP-1853864992-192.168.8.104-1473442535767/current/VERSION
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/data/data1/current/BP-1853864992-192.168.8.104-1473442535767/current/VERSION b/build/test/data/dfs/data/data1/current/BP-1853864992-192.168.8.104-1473442535767/current/VERSION
deleted file mode 100644
index 7b1e796..0000000
--- a/build/test/data/dfs/data/data1/current/BP-1853864992-192.168.8.104-1473442535767/current/VERSION
+++ /dev/null
@@ -1,5 +0,0 @@
-#Fri Sep 09 10:35:37 PDT 2016
-namespaceID=404750972
-cTime=0
-blockpoolID=BP-1853864992-192.168.8.104-1473442535767
-layoutVersion=-47
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/data/data1/current/BP-1853864992-192.168.8.104-1473442535767/dncp_block_verification.log.curr
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/data/data1/current/BP-1853864992-192.168.8.104-1473442535767/dncp_block_verification.log.curr b/build/test/data/dfs/data/data1/current/BP-1853864992-192.168.8.104-1473442535767/dncp_block_verification.log.curr
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/data/data1/current/VERSION
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/data/data1/current/VERSION b/build/test/data/dfs/data/data1/current/VERSION
deleted file mode 100644
index a58b113..0000000
--- a/build/test/data/dfs/data/data1/current/VERSION
+++ /dev/null
@@ -1,6 +0,0 @@
-#Fri Sep 09 10:35:37 PDT 2016
-storageID=DS-142611376-192.168.8.104-52719-1473442537270
-clusterID=testClusterID
-cTime=0
-storageType=DATA_NODE
-layoutVersion=-47
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/data/data1/in_use.lock
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/data/data1/in_use.lock b/build/test/data/dfs/data/data1/in_use.lock
deleted file mode 100644
index e2d3355..0000000
--- a/build/test/data/dfs/data/data1/in_use.lock
+++ /dev/null
@@ -1 +0,0 @@
-44184@Sisyphus.local
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/data/data2/current/BP-1853864992-192.168.8.104-1473442535767/current/VERSION
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/data/data2/current/BP-1853864992-192.168.8.104-1473442535767/current/VERSION b/build/test/data/dfs/data/data2/current/BP-1853864992-192.168.8.104-1473442535767/current/VERSION
deleted file mode 100644
index 7b1e796..0000000
--- a/build/test/data/dfs/data/data2/current/BP-1853864992-192.168.8.104-1473442535767/current/VERSION
+++ /dev/null
@@ -1,5 +0,0 @@
-#Fri Sep 09 10:35:37 PDT 2016
-namespaceID=404750972
-cTime=0
-blockpoolID=BP-1853864992-192.168.8.104-1473442535767
-layoutVersion=-47
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/data/data2/current/VERSION
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/data/data2/current/VERSION b/build/test/data/dfs/data/data2/current/VERSION
deleted file mode 100644
index a58b113..0000000
--- a/build/test/data/dfs/data/data2/current/VERSION
+++ /dev/null
@@ -1,6 +0,0 @@
-#Fri Sep 09 10:35:37 PDT 2016
-storageID=DS-142611376-192.168.8.104-52719-1473442537270
-clusterID=testClusterID
-cTime=0
-storageType=DATA_NODE
-layoutVersion=-47
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/data/data2/in_use.lock
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/data/data2/in_use.lock b/build/test/data/dfs/data/data2/in_use.lock
deleted file mode 100644
index e2d3355..0000000
--- a/build/test/data/dfs/data/data2/in_use.lock
+++ /dev/null
@@ -1 +0,0 @@
-44184@Sisyphus.local
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/data/data3/current/BP-1853864992-192.168.8.104-1473442535767/current/VERSION
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/data/data3/current/BP-1853864992-192.168.8.104-1473442535767/current/VERSION b/build/test/data/dfs/data/data3/current/BP-1853864992-192.168.8.104-1473442535767/current/VERSION
deleted file mode 100644
index 7b1e796..0000000
--- a/build/test/data/dfs/data/data3/current/BP-1853864992-192.168.8.104-1473442535767/current/VERSION
+++ /dev/null
@@ -1,5 +0,0 @@
-#Fri Sep 09 10:35:37 PDT 2016
-namespaceID=404750972
-cTime=0
-blockpoolID=BP-1853864992-192.168.8.104-1473442535767
-layoutVersion=-47
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/data/data3/current/BP-1853864992-192.168.8.104-1473442535767/dncp_block_verification.log.curr
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/data/data3/current/BP-1853864992-192.168.8.104-1473442535767/dncp_block_verification.log.curr b/build/test/data/dfs/data/data3/current/BP-1853864992-192.168.8.104-1473442535767/dncp_block_verification.log.curr
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/data/data3/current/VERSION
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/data/data3/current/VERSION b/build/test/data/dfs/data/data3/current/VERSION
deleted file mode 100644
index 7e828bf..0000000
--- a/build/test/data/dfs/data/data3/current/VERSION
+++ /dev/null
@@ -1,6 +0,0 @@
-#Fri Sep 09 10:35:37 PDT 2016
-storageID=DS-178448150-192.168.8.104-52786-1473442537270
-clusterID=testClusterID
-cTime=0
-storageType=DATA_NODE
-layoutVersion=-47
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/data/data3/in_use.lock
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/data/data3/in_use.lock b/build/test/data/dfs/data/data3/in_use.lock
deleted file mode 100644
index e2d3355..0000000
--- a/build/test/data/dfs/data/data3/in_use.lock
+++ /dev/null
@@ -1 +0,0 @@
-44184@Sisyphus.local
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/data/data4/current/BP-1853864992-192.168.8.104-1473442535767/current/VERSION
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/data/data4/current/BP-1853864992-192.168.8.104-1473442535767/current/VERSION b/build/test/data/dfs/data/data4/current/BP-1853864992-192.168.8.104-1473442535767/current/VERSION
deleted file mode 100644
index 7b1e796..0000000
--- a/build/test/data/dfs/data/data4/current/BP-1853864992-192.168.8.104-1473442535767/current/VERSION
+++ /dev/null
@@ -1,5 +0,0 @@
-#Fri Sep 09 10:35:37 PDT 2016
-namespaceID=404750972
-cTime=0
-blockpoolID=BP-1853864992-192.168.8.104-1473442535767
-layoutVersion=-47
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/data/data4/current/VERSION
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/data/data4/current/VERSION b/build/test/data/dfs/data/data4/current/VERSION
deleted file mode 100644
index 7e828bf..0000000
--- a/build/test/data/dfs/data/data4/current/VERSION
+++ /dev/null
@@ -1,6 +0,0 @@
-#Fri Sep 09 10:35:37 PDT 2016
-storageID=DS-178448150-192.168.8.104-52786-1473442537270
-clusterID=testClusterID
-cTime=0
-storageType=DATA_NODE
-layoutVersion=-47
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/data/data4/in_use.lock
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/data/data4/in_use.lock b/build/test/data/dfs/data/data4/in_use.lock
deleted file mode 100644
index e2d3355..0000000
--- a/build/test/data/dfs/data/data4/in_use.lock
+++ /dev/null
@@ -1 +0,0 @@
-44184@Sisyphus.local
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/name1/current/VERSION
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/name1/current/VERSION b/build/test/data/dfs/name1/current/VERSION
deleted file mode 100644
index 71ca2e0..0000000
--- a/build/test/data/dfs/name1/current/VERSION
+++ /dev/null
@@ -1,7 +0,0 @@
-#Fri Sep 09 10:35:35 PDT 2016
-namespaceID=404750972
-clusterID=testClusterID
-cTime=0
-storageType=NAME_NODE
-blockpoolID=BP-1853864992-192.168.8.104-1473442535767
-layoutVersion=-47
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/name1/current/edits_inprogress_0000000000000000001
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/name1/current/edits_inprogress_0000000000000000001 b/build/test/data/dfs/name1/current/edits_inprogress_0000000000000000001
deleted file mode 100644
index f1ff235..0000000
Binary files a/build/test/data/dfs/name1/current/edits_inprogress_0000000000000000001 and /dev/null differ
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/name1/current/fsimage_0000000000000000000
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/name1/current/fsimage_0000000000000000000 b/build/test/data/dfs/name1/current/fsimage_0000000000000000000
deleted file mode 100644
index c22c27e..0000000
Binary files a/build/test/data/dfs/name1/current/fsimage_0000000000000000000 and /dev/null differ
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/name1/current/fsimage_0000000000000000000.md5
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/name1/current/fsimage_0000000000000000000.md5 b/build/test/data/dfs/name1/current/fsimage_0000000000000000000.md5
deleted file mode 100644
index 645a3b7..0000000
--- a/build/test/data/dfs/name1/current/fsimage_0000000000000000000.md5
+++ /dev/null
@@ -1 +0,0 @@
-b8bf059807312f9ac971661b83eb3c56 *fsimage_0000000000000000000
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/name1/current/seen_txid
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/name1/current/seen_txid b/build/test/data/dfs/name1/current/seen_txid
deleted file mode 100644
index d00491f..0000000
--- a/build/test/data/dfs/name1/current/seen_txid
+++ /dev/null
@@ -1 +0,0 @@
-1
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/name1/in_use.lock
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/name1/in_use.lock b/build/test/data/dfs/name1/in_use.lock
deleted file mode 100644
index e2d3355..0000000
--- a/build/test/data/dfs/name1/in_use.lock
+++ /dev/null
@@ -1 +0,0 @@
-44184@Sisyphus.local
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/name2/current/VERSION
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/name2/current/VERSION b/build/test/data/dfs/name2/current/VERSION
deleted file mode 100644
index 71ca2e0..0000000
--- a/build/test/data/dfs/name2/current/VERSION
+++ /dev/null
@@ -1,7 +0,0 @@
-#Fri Sep 09 10:35:35 PDT 2016
-namespaceID=404750972
-clusterID=testClusterID
-cTime=0
-storageType=NAME_NODE
-blockpoolID=BP-1853864992-192.168.8.104-1473442535767
-layoutVersion=-47
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/name2/current/edits_inprogress_0000000000000000001
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/name2/current/edits_inprogress_0000000000000000001 b/build/test/data/dfs/name2/current/edits_inprogress_0000000000000000001
deleted file mode 100644
index f1ff235..0000000
Binary files a/build/test/data/dfs/name2/current/edits_inprogress_0000000000000000001 and /dev/null differ
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/name2/current/fsimage_0000000000000000000
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/name2/current/fsimage_0000000000000000000 b/build/test/data/dfs/name2/current/fsimage_0000000000000000000
deleted file mode 100644
index c22c27e..0000000
Binary files a/build/test/data/dfs/name2/current/fsimage_0000000000000000000 and /dev/null differ
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/name2/current/fsimage_0000000000000000000.md5
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/name2/current/fsimage_0000000000000000000.md5 b/build/test/data/dfs/name2/current/fsimage_0000000000000000000.md5
deleted file mode 100644
index 645a3b7..0000000
--- a/build/test/data/dfs/name2/current/fsimage_0000000000000000000.md5
+++ /dev/null
@@ -1 +0,0 @@
-b8bf059807312f9ac971661b83eb3c56 *fsimage_0000000000000000000
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/name2/current/seen_txid
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/name2/current/seen_txid b/build/test/data/dfs/name2/current/seen_txid
deleted file mode 100644
index d00491f..0000000
--- a/build/test/data/dfs/name2/current/seen_txid
+++ /dev/null
@@ -1 +0,0 @@
-1
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/build/test/data/dfs/name2/in_use.lock
----------------------------------------------------------------------
diff --git a/build/test/data/dfs/name2/in_use.lock b/build/test/data/dfs/name2/in_use.lock
deleted file mode 100644
index e2d3355..0000000
--- a/build/test/data/dfs/name2/in_use.lock
+++ /dev/null
@@ -1 +0,0 @@
-44184@Sisyphus.local
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index 72dcd33..0000000
--- a/pom.xml
+++ /dev/null
@@ -1,206 +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.
- !-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.asterix</groupId>
- <artifactId>apache-asterixdb</artifactId>
- <version>0.8.9-SNAPSHOT</version>
- </parent>
- <artifactId>asterix-opt</artifactId>
- <properties>
- <asterix.version>0.8.9-SNAPSHOT</asterix.version>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.asterix</groupId>
- <artifactId>asterix-grammar-extension-maven-plugin</artifactId>
- <version>${asterix.version}</version>
- <configuration>
- <base>${project.basedir}</base>
- <gbase>../asterix-lang-aql/src/main/javacc/AQL.jj</gbase>
- <gextension>src/main/resources/lang-extension/lang.txt</gextension>
- <output>target/generated-resources/javacc/grammar.jj</output>
- <parserClassName>BADAQLParser</parserClassName>
- <packageName>org.apache.asterix.bad.lang</packageName>
- </configuration>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <goals>
- <goal>grammarix</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>javacc-maven-plugin</artifactId>
- <version>2.6</version>
- <executions>
- <execution>
- <id>javacc</id>
- <goals>
- <goal>javacc</goal>
- </goals>
- <configuration>
- <isStatic>false</isStatic>
- <javaUnicodeEscape>true</javaUnicodeEscape>
- <sourceDirectory>target/generated-resources/javacc</sourceDirectory>
- </configuration>
- </execution>
- <execution>
- <id>javacc-jjdoc</id>
- <goals>
- <goal>jjdoc</goal>
- </goals>
- <phase>process-sources</phase>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.9</version>
- <executions>
- <execution>
- <id>add-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>${project.build.directory}/generated-sources/javacc/</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- <pluginManagement>
- <plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>org.apache.asterix</groupId>
- <artifactId>asterix-grammar-extension-maven-plugin</artifactId>
- <versionRange>[${asterix.version},)</versionRange>
- <goals>
- <goal>grammarix</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore></ignore>
- </action>
- </pluginExecution>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>javacc-maven-plugin</artifactId>
- <versionRange>[2.6,)</versionRange>
- <goals>
- <goal>javacc</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore></ignore>
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.apache.asterix</groupId>
- <artifactId>asterix-om</artifactId>
- <version>${project.version}</version>
- <type>jar</type>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.hyracks</groupId>
- <artifactId>hyracks-test-support</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.asterix</groupId>
- <artifactId>asterix-runtime</artifactId>
- <version>${project.version}</version>
- <type>jar</type>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.hyracks</groupId>
- <artifactId>algebricks-compiler</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.hyracks</groupId>
- <artifactId>hyracks-hdfs-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.asterix</groupId>
- <artifactId>asterix-common</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.asterix</groupId>
- <artifactId>asterix-test-framework</artifactId>
- <version>${asterix.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.asterix</groupId>
- <artifactId>asterix-active</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.asterix</groupId>
- <artifactId>asterix-app</artifactId>
- <version>${asterix.version}</version>
- <type>jar</type>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.asterix</groupId>
- <artifactId>asterix-app</artifactId>
- <version>${asterix.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.asterix</groupId>
- <artifactId>asterix-common</artifactId>
- <version>${asterix.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/src/main/java/org/apache/asterix/bad/BADConstants.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/asterix/bad/BADConstants.java b/src/main/java/org/apache/asterix/bad/BADConstants.java
deleted file mode 100644
index aeef031..0000000
--- a/src/main/java/org/apache/asterix/bad/BADConstants.java
+++ /dev/null
@@ -1,41 +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.
- */
-package org.apache.asterix.bad;
-
-public interface BADConstants {
- final String SubscriptionId = "subscriptionId";
- final String BrokerName = "BrokerName";
- final String BrokerDataverse = "DataverseName";
- final String BrokerEndPoint = "BrokerEndPoint";
- final String DeliveryTime = "deliveryTime";
- final String ResultId = "resultId";
- final String ChannelExecutionTime = "channelExecutionTime";
- final String ChannelSubscriptionsType = "ChannelSubscriptionsType";
- final String ChannelResultsType = "ChannelResultsType";
- final String FEED_EXTENSION_NAME = "Feed";
- final String CHANNEL_EXTENSION_NAME = "Subscriptions";
- final String subscriptionEnding = "Results";
- final String resultsEnding = "Channel";
- final String BAD_METADATA_EXTENSION_NAME = "BADMetadataExtension";
- final String BAD_DATAVERSE_NAME = "BAD";
-
- public enum ChannelJobType {
- REPETITIVE
- }
-}
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/src/main/java/org/apache/asterix/bad/ChannelJobInfo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/asterix/bad/ChannelJobInfo.java b/src/main/java/org/apache/asterix/bad/ChannelJobInfo.java
deleted file mode 100644
index da0c43b..0000000
--- a/src/main/java/org/apache/asterix/bad/ChannelJobInfo.java
+++ /dev/null
@@ -1,48 +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.
- */
-package org.apache.asterix.bad;
-
-import java.util.List;
-
-import org.apache.asterix.active.ActiveJob;
-import org.apache.asterix.active.ActivityState;
-import org.apache.asterix.active.EntityId;
-import org.apache.asterix.bad.BADConstants.ChannelJobType;
-import org.apache.hyracks.api.job.JobId;
-import org.apache.hyracks.api.job.JobSpecification;
-
-public class ChannelJobInfo extends ActiveJob {
-
- private static final long serialVersionUID = 1L;
- private List<String> locations;
-
- public ChannelJobInfo(EntityId entityId, JobId jobId, ActivityState state, JobSpecification spec) {
- super(entityId, jobId, state, ChannelJobType.REPETITIVE, spec);
- }
-
- public List<String> getLocations() {
- return locations;
-
- }
-
- public void setLocations(List<String> locations) {
- this.locations = locations;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/src/main/java/org/apache/asterix/bad/ChannelJobService.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/asterix/bad/ChannelJobService.java b/src/main/java/org/apache/asterix/bad/ChannelJobService.java
deleted file mode 100644
index 8310f70..0000000
--- a/src/main/java/org/apache/asterix/bad/ChannelJobService.java
+++ /dev/null
@@ -1,145 +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.
- */
-package org.apache.asterix.bad;
-
-import java.io.BufferedReader;
-import java.io.DataOutputStream;
-import java.io.InputStreamReader;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.asterix.active.EntityId;
-import org.apache.asterix.common.exceptions.AsterixException;
-import org.apache.asterix.om.base.AOrderedList;
-import org.apache.asterix.om.base.AUUID;
-import org.apache.hyracks.api.client.HyracksConnection;
-import org.apache.hyracks.api.client.IHyracksClientConnection;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-import org.apache.hyracks.api.job.JobId;
-import org.apache.hyracks.api.job.JobSpecification;
-import org.json.JSONException;
-
-/**
- * Provides functionality for running channel jobs and communicating with Brokers
- */
-public class ChannelJobService {
-
- private static final Logger LOGGER = Logger.getLogger(ChannelJobService.class.getName());
- IHyracksClientConnection hcc;
-
- public ChannelJobService() throws AsterixException {
-
- }
-
- public void runChannelJob(JobSpecification channeljobSpec, String strIP, int port) throws Exception {
- hcc = new HyracksConnection(strIP, port);
- JobId jobId = hcc.startJob(channeljobSpec);
- hcc.waitForCompletion(jobId);
- }
-
- public void sendBrokerNotificationsForChannel(EntityId activeJobId, String brokerEndpoint,
- AOrderedList subscriptionIds, String channelExecutionTime) throws HyracksDataException {
- String formattedString;
- try {
- formattedString = formatJSON(activeJobId, subscriptionIds, channelExecutionTime);
- } catch (JSONException e) {
- throw new HyracksDataException(e);
- }
- sendMessage(brokerEndpoint, formattedString);
- }
-
- public String formatJSON(EntityId activeJobId, AOrderedList subscriptionIds, String channelExecutionTime)
- throws JSONException {
- String JSON = "{ \"dataverseName\":\"" + activeJobId.getDataverse() + "\", \"channelName\":\""
- + activeJobId.getEntityName() + "\", \"" + BADConstants.ChannelExecutionTime + "\":\""
- + channelExecutionTime + "\", \"subscriptionIds\":[";
- for (int i = 0; i < subscriptionIds.size(); i++) {
- AUUID subId = (AUUID) subscriptionIds.getItem(i);
- String subString = subId.toSimpleString();
- JSON += "\"" + subString + "\"";
- if (i < subscriptionIds.size() - 1) {
- JSON += ",";
- }
- }
- JSON += "]}";
- return JSON;
-
- }
-
- public static void sendMessage(String targetURL, String urlParameters) {
- HttpURLConnection connection = null;
- try {
- //Create connection
- URL url = new URL(targetURL);
- connection = (HttpURLConnection) url.openConnection();
- connection.setRequestMethod("POST");
- connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
-
- connection.setRequestProperty("Content-Length", Integer.toString(urlParameters.getBytes().length));
- connection.setRequestProperty("Content-Language", "en-US");
-
- connection.setUseCaches(false);
- connection.setDoOutput(true);
-
- //Send message
- try {
- DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
- wr.writeBytes(urlParameters);
- wr.close();
- } catch (Exception e) {
- throw new AsterixException("Broker connection failed to write", e);
- }
-
- if (LOGGER.isLoggable(Level.INFO)) {
- int responseCode = connection.getResponseCode();
- LOGGER.info("\nSending 'POST' request to URL : " + url);
- LOGGER.info("Post parameters : " + urlParameters);
- LOGGER.info("Response Code : " + responseCode);
- }
-
- BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
- String inputLine;
- StringBuffer response = new StringBuffer();
-
- while ((inputLine = in.readLine()) != null) {
- response.append(inputLine);
- }
- in.close();
-
- if (LOGGER.isLoggable(Level.INFO)) {
- System.out.println(response.toString());
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- } finally {
- if (connection != null) {
- connection.disconnect();
- }
- }
- }
-
- @Override
- public String toString() {
- return "ChannelJobService";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/src/main/java/org/apache/asterix/bad/lang/BADCompilationProvider.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/asterix/bad/lang/BADCompilationProvider.java b/src/main/java/org/apache/asterix/bad/lang/BADCompilationProvider.java
deleted file mode 100644
index 42036af..0000000
--- a/src/main/java/org/apache/asterix/bad/lang/BADCompilationProvider.java
+++ /dev/null
@@ -1,52 +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.
- */
-package org.apache.asterix.bad.lang;
-
-import org.apache.asterix.algebra.base.ILangExpressionToPlanTranslatorFactory;
-import org.apache.asterix.compiler.provider.ILangCompilationProvider;
-import org.apache.asterix.lang.aql.rewrites.AQLRewriterFactory;
-import org.apache.asterix.lang.aql.visitor.AQLAstPrintVisitorFactory;
-import org.apache.asterix.lang.common.base.IAstPrintVisitorFactory;
-import org.apache.asterix.lang.common.base.IParserFactory;
-import org.apache.asterix.lang.common.base.IRewriterFactory;
-import org.apache.asterix.translator.AqlExpressionToPlanTranslatorFactory;
-
-public class BADCompilationProvider implements ILangCompilationProvider {
-
- @Override
- public IParserFactory getParserFactory() {
- return new BADParserFactory();
- }
-
- @Override
- public IRewriterFactory getRewriterFactory() {
- return new AQLRewriterFactory();
- }
-
- @Override
- public IAstPrintVisitorFactory getAstPrintVisitorFactory() {
- return new AQLAstPrintVisitorFactory();
- }
-
- @Override
- public ILangExpressionToPlanTranslatorFactory getExpressionToPlanTranslatorFactory() {
- return new AqlExpressionToPlanTranslatorFactory();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/src/main/java/org/apache/asterix/bad/lang/BADLangExtension.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/asterix/bad/lang/BADLangExtension.java b/src/main/java/org/apache/asterix/bad/lang/BADLangExtension.java
deleted file mode 100644
index 9832fe6..0000000
--- a/src/main/java/org/apache/asterix/bad/lang/BADLangExtension.java
+++ /dev/null
@@ -1,106 +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.
- */
-package org.apache.asterix.bad.lang;
-
-import java.util.List;
-
-import org.apache.asterix.algebra.base.ILangExtension;
-import org.apache.asterix.bad.metadata.Broker;
-import org.apache.asterix.bad.metadata.BrokerSearchKey;
-import org.apache.asterix.bad.metadata.Channel;
-import org.apache.asterix.bad.metadata.ChannelSearchKey;
-import org.apache.asterix.common.api.ExtensionId;
-import org.apache.asterix.compiler.provider.ILangCompilationProvider;
-import org.apache.asterix.compiler.provider.SqlppCompilationProvider;
-import org.apache.asterix.metadata.MetadataManager;
-import org.apache.asterix.metadata.MetadataTransactionContext;
-import org.apache.commons.lang3.mutable.Mutable;
-import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
-import org.apache.hyracks.algebricks.common.utils.Pair;
-import org.apache.hyracks.algebricks.core.algebra.base.ILogicalExpression;
-import org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator;
-import org.apache.hyracks.algebricks.core.algebra.base.IOptimizationContext;
-import org.apache.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
-import org.apache.hyracks.algebricks.core.algebra.operators.logical.UnnestOperator;
-
-public class BADLangExtension implements ILangExtension {
-
- public static final ExtensionId EXTENSION_ID = new ExtensionId(BADLangExtension.class.getSimpleName(), 0);
-
- @Override
- public ExtensionId getId() {
- return EXTENSION_ID;
- }
-
- @Override
- public void configure(List<Pair<String, String>> args) {
- }
-
- @Override
- public ILangCompilationProvider getLangCompilationProvider(Language lang) {
- switch (lang) {
- case AQL:
- return new BADCompilationProvider();
- case SQLPP:
- return new SqlppCompilationProvider();
- default:
- return null;
- }
- }
-
- @Override
- public ExtensionKind getExtensionKind() {
- return ExtensionKind.LANG;
- }
-
- @Override
- public boolean unnestToDataScan(Mutable<ILogicalOperator> opRef, IOptimizationContext context,
- UnnestOperator unnestOp, ILogicalExpression unnestExpr, AbstractFunctionCallExpression functionCallExpr)
- throws AlgebricksException {
- // TODO I dont need this?????
- return false;
- }
-
- public static Broker getBroker(MetadataTransactionContext mdTxnCtx, String dataverseName, String brokerName)
- throws AlgebricksException {
- BrokerSearchKey brokerSearchKey = new BrokerSearchKey(dataverseName, brokerName);
- List<Broker> brokers = MetadataManager.INSTANCE.getEntities(mdTxnCtx, brokerSearchKey);
- if (brokers.isEmpty()) {
- return null;
- } else if (brokers.size() > 1) {
- throw new AlgebricksException("Broker search key returned more than one broker");
- } else {
- return brokers.get(0);
- }
- }
-
- public static Channel getChannel(MetadataTransactionContext mdTxnCtx, String dataverseName, String channelName)
- throws AlgebricksException {
- ChannelSearchKey channelSearchKey = new ChannelSearchKey(dataverseName, channelName);
- List<Channel> channels = MetadataManager.INSTANCE.getEntities(mdTxnCtx, channelSearchKey);
- if (channels.isEmpty()) {
- return null;
- } else if (channels.size() > 1) {
- throw new AlgebricksException("Channel search key returned more than one channel");
- } else {
- return channels.get(0);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/src/main/java/org/apache/asterix/bad/lang/BADParserFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/asterix/bad/lang/BADParserFactory.java b/src/main/java/org/apache/asterix/bad/lang/BADParserFactory.java
deleted file mode 100644
index 58bca17..0000000
--- a/src/main/java/org/apache/asterix/bad/lang/BADParserFactory.java
+++ /dev/null
@@ -1,38 +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.
- */
-package org.apache.asterix.bad.lang;
-
-import java.io.Reader;
-
-import org.apache.asterix.lang.common.base.IParser;
-import org.apache.asterix.lang.common.base.IParserFactory;
-
-public class BADParserFactory implements IParserFactory {
-
- @Override
- public IParser createParser(String query) {
- return new BADAQLParser(query);
- }
-
- @Override
- public IParser createParser(Reader reader) {
- return new BADAQLParser(reader);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/src/main/java/org/apache/asterix/bad/lang/BADQueryTranslatorExtension.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/asterix/bad/lang/BADQueryTranslatorExtension.java b/src/main/java/org/apache/asterix/bad/lang/BADQueryTranslatorExtension.java
deleted file mode 100644
index 4198230..0000000
--- a/src/main/java/org/apache/asterix/bad/lang/BADQueryTranslatorExtension.java
+++ /dev/null
@@ -1,53 +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.
- */
-package org.apache.asterix.bad.lang;
-
-import java.util.List;
-
-import org.apache.asterix.app.cc.CompilerExtensionManager;
-import org.apache.asterix.app.cc.IStatementExecutorExtension;
-import org.apache.asterix.common.api.ExtensionId;
-import org.apache.asterix.runtime.util.AsterixAppContextInfo;
-import org.apache.asterix.translator.IStatementExecutorFactory;
-import org.apache.hyracks.algebricks.common.utils.Pair;
-
-public class BADQueryTranslatorExtension implements IStatementExecutorExtension {
-
- public static final ExtensionId BAD_QUERY_TRANSLATOR_EXTENSION_ID = new ExtensionId(
- BADQueryTranslatorExtension.class.getSimpleName(), 0);
-
- private static class LazyHolder {
- private static final IStatementExecutorFactory INSTANCE = new BADQueryTranslatorFactory(
- (CompilerExtensionManager) AsterixAppContextInfo.INSTANCE.getExtensionManager());
- }
-
- @Override
- public ExtensionId getId() {
- return BAD_QUERY_TRANSLATOR_EXTENSION_ID;
- }
-
- @Override
- public void configure(List<Pair<String, String>> args) {
- }
-
- @Override
- public IStatementExecutorFactory getQueryTranslatorFactory() {
- return LazyHolder.INSTANCE;
- }
-}
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/src/main/java/org/apache/asterix/bad/lang/BADQueryTranslatorFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/asterix/bad/lang/BADQueryTranslatorFactory.java b/src/main/java/org/apache/asterix/bad/lang/BADQueryTranslatorFactory.java
deleted file mode 100644
index b8a6050..0000000
--- a/src/main/java/org/apache/asterix/bad/lang/BADQueryTranslatorFactory.java
+++ /dev/null
@@ -1,41 +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.
- */
-package org.apache.asterix.bad.lang;
-
-import java.util.List;
-
-import org.apache.asterix.app.cc.CompilerExtensionManager;
-import org.apache.asterix.app.translator.DefaultStatementExecutorFactory;
-import org.apache.asterix.app.translator.QueryTranslator;
-import org.apache.asterix.common.app.SessionConfig;
-import org.apache.asterix.compiler.provider.ILangCompilationProvider;
-import org.apache.asterix.lang.common.base.Statement;
-
-public class BADQueryTranslatorFactory extends DefaultStatementExecutorFactory {
-
- public BADQueryTranslatorFactory(CompilerExtensionManager ccExtensionManager) {
- super(ccExtensionManager);
- }
-
- @Override
- public QueryTranslator create(List<Statement> statements, SessionConfig conf,
- ILangCompilationProvider compilationProvider) {
- return new BADStatementExecutor(statements, conf, compilationProvider, cExtensionManager);
- }
-}
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/src/main/java/org/apache/asterix/bad/lang/BADStatementExecutor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/asterix/bad/lang/BADStatementExecutor.java b/src/main/java/org/apache/asterix/bad/lang/BADStatementExecutor.java
deleted file mode 100644
index 1c17794..0000000
--- a/src/main/java/org/apache/asterix/bad/lang/BADStatementExecutor.java
+++ /dev/null
@@ -1,46 +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.
- */
-package org.apache.asterix.bad.lang;
-
-import java.util.List;
-
-import org.apache.asterix.app.cc.CompilerExtensionManager;
-import org.apache.asterix.app.translator.QueryTranslator;
-import org.apache.asterix.common.app.SessionConfig;
-import org.apache.asterix.compiler.provider.ILangCompilationProvider;
-import org.apache.asterix.lang.common.base.Statement;
-import org.apache.asterix.metadata.declared.AqlMetadataProvider;
-import org.apache.hyracks.api.client.IHyracksClientConnection;
-
-public class BADStatementExecutor extends QueryTranslator {
-
- public BADStatementExecutor(List<Statement> aqlStatements, SessionConfig conf,
- ILangCompilationProvider compliationProvider, CompilerExtensionManager ccExtensionManager) {
- super(aqlStatements, conf, compliationProvider, ccExtensionManager);
- }
-
- @Override
- protected void handleDataverseDropStatement(AqlMetadataProvider metadataProvider, Statement stmt,
- IHyracksClientConnection hcc) throws Exception {
- //super(metadataProvider, stmt, hcc);
- //TODO: need to drop channels and brokers
- //TODO: need to check if datasets or functions are in use by channels
- }
-
-}
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/src/main/java/org/apache/asterix/bad/lang/statement/BrokerDropStatement.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/asterix/bad/lang/statement/BrokerDropStatement.java b/src/main/java/org/apache/asterix/bad/lang/statement/BrokerDropStatement.java
deleted file mode 100644
index d89617b..0000000
--- a/src/main/java/org/apache/asterix/bad/lang/statement/BrokerDropStatement.java
+++ /dev/null
@@ -1,99 +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.
- */
-package org.apache.asterix.bad.lang.statement;
-
-import org.apache.asterix.algebra.extension.IExtensionStatement;
-import org.apache.asterix.app.translator.QueryTranslator;
-import org.apache.asterix.bad.lang.BADLangExtension;
-import org.apache.asterix.bad.metadata.Broker;
-import org.apache.asterix.common.exceptions.AsterixException;
-import org.apache.asterix.lang.common.struct.Identifier;
-import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
-import org.apache.asterix.metadata.MetadataManager;
-import org.apache.asterix.metadata.MetadataTransactionContext;
-import org.apache.asterix.metadata.declared.AqlMetadataProvider;
-import org.apache.asterix.translator.IStatementExecutor;
-import org.apache.asterix.translator.IStatementExecutor.ResultDelivery;
-import org.apache.asterix.translator.IStatementExecutor.Stats;
-import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
-import org.apache.hyracks.api.client.IHyracksClientConnection;
-import org.apache.hyracks.api.dataset.IHyracksDataset;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-
-public class BrokerDropStatement implements IExtensionStatement {
-
- private final Identifier dataverseName;
- private final Identifier brokerName;
- private boolean ifExists;
-
- public BrokerDropStatement(Identifier dataverseName, Identifier brokerName, boolean ifExists) {
- this.brokerName = brokerName;
- this.dataverseName = dataverseName;
- this.ifExists = ifExists;
- }
-
- public boolean getIfExists() {
- return ifExists;
- }
-
- public Identifier getDataverseName() {
- return dataverseName;
- }
-
- public Identifier getBrokerName() {
- return brokerName;
- }
-
- @Override
- public byte getKind() {
- return Kind.EXTENSION;
- }
-
- @Override
- public byte getCategory() {
- return Category.DDL;
- }
-
- @Override
- public <R, T> R accept(ILangVisitor<R, T> visitor, T arg) throws AsterixException {
- return null;
- }
-
- @Override
- public void handle(IStatementExecutor statementExecutor, AqlMetadataProvider metadataProvider,
- IHyracksClientConnection hcc, IHyracksDataset hdc, ResultDelivery resultDelivery, Stats stats)
- throws HyracksDataException, AlgebricksException {
- //TODO: dont drop a broker that's being used
- MetadataTransactionContext mdTxnCtx = null;
- try {
- mdTxnCtx = MetadataManager.INSTANCE.beginTransaction();
- metadataProvider.setMetadataTxnContext(mdTxnCtx);
- Broker broker = BADLangExtension.getBroker(mdTxnCtx, dataverseName.getValue(), brokerName.getValue());
- if (broker == null) {
- throw new AlgebricksException("A broker with this name " + brokerName + " doesn't exist.");
- }
- MetadataManager.INSTANCE.deleteEntity(mdTxnCtx, broker);
- MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
- } catch (Exception e) {
- QueryTranslator.abort(e, e, mdTxnCtx);
- throw new HyracksDataException(e);
- }
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/src/main/java/org/apache/asterix/bad/lang/statement/ChannelDropStatement.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/asterix/bad/lang/statement/ChannelDropStatement.java b/src/main/java/org/apache/asterix/bad/lang/statement/ChannelDropStatement.java
deleted file mode 100644
index 60fcf1f..0000000
--- a/src/main/java/org/apache/asterix/bad/lang/statement/ChannelDropStatement.java
+++ /dev/null
@@ -1,166 +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.
- */
-package org.apache.asterix.bad.lang.statement;
-
-import org.apache.asterix.active.ActiveJobNotificationHandler;
-import org.apache.asterix.active.ActiveRuntimeId;
-import org.apache.asterix.active.EntityId;
-import org.apache.asterix.active.message.ActiveManagerMessage;
-import org.apache.asterix.algebra.extension.IExtensionStatement;
-import org.apache.asterix.app.translator.QueryTranslator;
-import org.apache.asterix.bad.BADConstants;
-import org.apache.asterix.bad.lang.BADLangExtension;
-import org.apache.asterix.bad.metadata.Channel;
-import org.apache.asterix.bad.metadata.ChannelEventsListener;
-import org.apache.asterix.bad.runtime.RepetitiveChannelOperatorNodePushable;
-import org.apache.asterix.common.exceptions.AsterixException;
-import org.apache.asterix.common.messaging.api.ICCMessageBroker;
-import org.apache.asterix.external.feed.api.IActiveLifecycleEventSubscriber;
-import org.apache.asterix.external.feed.api.IActiveLifecycleEventSubscriber.ActiveLifecycleEvent;
-import org.apache.asterix.external.feed.management.ActiveLifecycleEventSubscriber;
-import org.apache.asterix.lang.common.statement.DropDatasetStatement;
-import org.apache.asterix.lang.common.struct.Identifier;
-import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
-import org.apache.asterix.metadata.MetadataManager;
-import org.apache.asterix.metadata.MetadataTransactionContext;
-import org.apache.asterix.metadata.declared.AqlMetadataProvider;
-import org.apache.asterix.runtime.util.AsterixAppContextInfo;
-import org.apache.asterix.translator.IStatementExecutor;
-import org.apache.asterix.translator.IStatementExecutor.ResultDelivery;
-import org.apache.asterix.translator.IStatementExecutor.Stats;
-import org.apache.hyracks.algebricks.common.constraints.AlgebricksAbsolutePartitionConstraint;
-import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
-import org.apache.hyracks.api.client.IHyracksClientConnection;
-import org.apache.hyracks.api.dataset.IHyracksDataset;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-
-public class ChannelDropStatement implements IExtensionStatement {
-
- private final Identifier dataverseName;
- private final Identifier channelName;
- private boolean ifExists;
-
- public ChannelDropStatement(Identifier dataverseName, Identifier channelName, boolean ifExists) {
- this.dataverseName = dataverseName;
- this.channelName = channelName;
- this.ifExists = ifExists;
- }
-
- public Identifier getDataverseName() {
- return dataverseName;
- }
-
- public Identifier getChannelName() {
- return channelName;
- }
-
- public boolean getIfExists() {
- return ifExists;
- }
-
- @Override
- public byte getKind() {
- return Kind.EXTENSION;
- }
-
- @Override
- public byte getCategory() {
- return Category.DDL;
- }
-
- @Override
- public <R, T> R accept(ILangVisitor<R, T> visitor, T arg) throws AsterixException {
- return null;
- }
-
- @Override
- public void handle(IStatementExecutor statementExecutor, AqlMetadataProvider metadataProvider,
- IHyracksClientConnection hcc, IHyracksDataset hdc, ResultDelivery resultDelivery, Stats stats)
- throws HyracksDataException, AlgebricksException {
- boolean txnActive = false;
- EntityId entityId = new EntityId(BADConstants.CHANNEL_EXTENSION_NAME, dataverseName.getValue(),
- channelName.getValue());
- ChannelEventsListener listener = (ChannelEventsListener) ActiveJobNotificationHandler.INSTANCE
- .getActiveEntityListener(entityId);
- IActiveLifecycleEventSubscriber eventSubscriber = new ActiveLifecycleEventSubscriber();
- boolean subscriberRegistered = false;
- Channel channel = null;
-
- MetadataTransactionContext mdTxnCtx = null;
- try {
- mdTxnCtx = MetadataManager.INSTANCE.beginTransaction();
- txnActive = true;
- channel = BADLangExtension.getChannel(mdTxnCtx, dataverseName.getValue(), channelName.getValue());
- MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
- txnActive = false;
- if (channel == null) {
- if (ifExists) {
- MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
- return;
- } else {
- throw new AlgebricksException("There is no channel with this name " + channelName + ".");
- }
- }
- if (listener != null) {
- subscriberRegistered = listener.isChannelActive(entityId, eventSubscriber);
- }
- if (!subscriberRegistered) {
- throw new AsterixException("Channel " + channelName + " is not running");
- }
-
- ICCMessageBroker messageBroker = (ICCMessageBroker) AsterixAppContextInfo.INSTANCE.getCCApplicationContext()
- .getMessageBroker();
- AlgebricksAbsolutePartitionConstraint locations = channel.getPartitionConstraint();
- int partition = 0;
- for (String location : locations.getLocations()) {
- messageBroker.sendApplicationMessageToNC(
- new ActiveManagerMessage(ActiveManagerMessage.STOP_ACTIVITY, "cc",
- new ActiveRuntimeId(channel.getChannelId(),
- RepetitiveChannelOperatorNodePushable.class.getSimpleName(), partition++)),
- location);
- }
- eventSubscriber.assertEvent(ActiveLifecycleEvent.ACTIVE_JOB_ENDED);
-
- //Drop the Channel Datasets
- //TODO: Need to find some way to handle if this fails.
- //TODO: Prevent datasets for Channels from being dropped elsewhere
- DropDatasetStatement dropStmt = new DropDatasetStatement(dataverseName,
- new Identifier(channel.getResultsDatasetName()), true);
- ((QueryTranslator) statementExecutor).handleDatasetDropStatement(metadataProvider, dropStmt, hcc);
-
- dropStmt = new DropDatasetStatement(dataverseName, new Identifier(channel.getSubscriptionsDataset()), true);
- ((QueryTranslator) statementExecutor).handleDatasetDropStatement(metadataProvider, dropStmt, hcc);
-
- if (subscriberRegistered) {
- listener.deregisterEventSubscriber(eventSubscriber);
- }
-
- //Remove the Channel Metadata
- MetadataManager.INSTANCE.deleteEntity(mdTxnCtx, channel);
- MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
- } catch (Exception e) {
- e.printStackTrace();
- if (txnActive) {
- QueryTranslator.abort(e, e, mdTxnCtx);
- }
- throw new HyracksDataException(e);
- }
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/src/main/java/org/apache/asterix/bad/lang/statement/ChannelSubscribeStatement.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/asterix/bad/lang/statement/ChannelSubscribeStatement.java b/src/main/java/org/apache/asterix/bad/lang/statement/ChannelSubscribeStatement.java
deleted file mode 100644
index bfa6bf1..0000000
--- a/src/main/java/org/apache/asterix/bad/lang/statement/ChannelSubscribeStatement.java
+++ /dev/null
@@ -1,202 +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.
- */
-package org.apache.asterix.bad.lang.statement;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.asterix.algebra.extension.IExtensionStatement;
-import org.apache.asterix.app.translator.QueryTranslator;
-import org.apache.asterix.bad.BADConstants;
-import org.apache.asterix.bad.lang.BADLangExtension;
-import org.apache.asterix.bad.metadata.Broker;
-import org.apache.asterix.bad.metadata.Channel;
-import org.apache.asterix.common.exceptions.AsterixException;
-import org.apache.asterix.common.functions.FunctionSignature;
-import org.apache.asterix.lang.common.base.Expression;
-import org.apache.asterix.lang.common.expression.CallExpr;
-import org.apache.asterix.lang.common.expression.FieldBinding;
-import org.apache.asterix.lang.common.expression.LiteralExpr;
-import org.apache.asterix.lang.common.expression.RecordConstructor;
-import org.apache.asterix.lang.common.literal.StringLiteral;
-import org.apache.asterix.lang.common.statement.InsertStatement;
-import org.apache.asterix.lang.common.statement.Query;
-import org.apache.asterix.lang.common.statement.UpsertStatement;
-import org.apache.asterix.lang.common.struct.Identifier;
-import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
-import org.apache.asterix.metadata.MetadataManager;
-import org.apache.asterix.metadata.MetadataTransactionContext;
-import org.apache.asterix.metadata.declared.AqlMetadataProvider;
-import org.apache.asterix.om.functions.AsterixBuiltinFunctions;
-import org.apache.asterix.translator.IStatementExecutor;
-import org.apache.asterix.translator.IStatementExecutor.ResultDelivery;
-import org.apache.asterix.translator.IStatementExecutor.Stats;
-import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
-import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
-import org.apache.hyracks.api.client.IHyracksClientConnection;
-import org.apache.hyracks.api.dataset.IHyracksDataset;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-
-public class ChannelSubscribeStatement implements IExtensionStatement {
-
- private final Identifier dataverseName;
- private final Identifier channelName;
- private final Identifier brokerDataverseName;
- private final Identifier brokerName;
- private final List<Expression> argList;
- private final String subscriptionId;
- private final int varCounter;
-
- public ChannelSubscribeStatement(Identifier dataverseName, Identifier channelName, List<Expression> argList,
- int varCounter, Identifier brokerDataverseName, Identifier brokerName, String subscriptionId) {
- this.channelName = channelName;
- this.dataverseName = dataverseName;
- this.brokerDataverseName = brokerDataverseName;
- this.brokerName = brokerName;
- this.argList = argList;
- this.subscriptionId = subscriptionId;
- this.varCounter = varCounter;
- }
-
- public Identifier getDataverseName() {
- return dataverseName;
- }
-
- public Identifier getBrokerDataverseName() {
- return brokerDataverseName;
- }
-
- public Identifier getChannelName() {
- return channelName;
- }
-
- public Identifier getBrokerName() {
- return brokerName;
- }
-
- public List<Expression> getArgList() {
- return argList;
- }
-
- public int getVarCounter() {
- return varCounter;
- }
-
- public String getSubscriptionId() {
- return subscriptionId;
- }
-
- @Override
- public byte getKind() {
- return Kind.EXTENSION;
- }
-
- @Override
- public byte getCategory() {
- return Category.QUERY;
- }
-
- @Override
- public <R, T> R accept(ILangVisitor<R, T> visitor, T arg) throws AsterixException {
- return null;
- }
-
- @Override
- public void handle(IStatementExecutor statementExecutor, AqlMetadataProvider metadataProvider,
- IHyracksClientConnection hcc, IHyracksDataset hdc, ResultDelivery resultDelivery, Stats stats)
- throws HyracksDataException, AlgebricksException {
-
- MetadataTransactionContext mdTxnCtx = null;
- try {
- mdTxnCtx = MetadataManager.INSTANCE.beginTransaction();
-
- Channel channel = BADLangExtension.getChannel(mdTxnCtx, dataverseName.getValue(), channelName.getValue());
- if (channel == null) {
- throw new AsterixException("There is no channel with this name " + channelName + ".");
- }
- Broker broker = BADLangExtension.getBroker(mdTxnCtx, brokerDataverseName.getValue(), brokerName.getValue());
- if (broker == null) {
- throw new AsterixException("There is no broker with this name " + brokerName + ".");
- }
-
- String subscriptionsDatasetName = channel.getSubscriptionsDataset();
- List<String> returnField = new ArrayList<String>();
- returnField.add(BADConstants.SubscriptionId);
-
- if (argList.size() != channel.getFunction().getArity()) {
- throw new AsterixException("Channel expected " + channel.getFunction().getArity()
- + " parameters but got " + argList.size());
- }
-
- Query subscriptionTuple = new Query(false);
-
- List<FieldBinding> fb = new ArrayList<FieldBinding>();
- LiteralExpr leftExpr = new LiteralExpr(new StringLiteral(BADConstants.BrokerDataverse));
- Expression rightExpr = new LiteralExpr(new StringLiteral(broker.getDataverseName()));
- fb.add(new FieldBinding(leftExpr, rightExpr));
-
- leftExpr = new LiteralExpr(new StringLiteral(BADConstants.BrokerName));
- rightExpr = new LiteralExpr(new StringLiteral(broker.getBrokerName()));
- fb.add(new FieldBinding(leftExpr, rightExpr));
-
- if (subscriptionId != null) {
- leftExpr = new LiteralExpr(new StringLiteral(BADConstants.SubscriptionId));
-
- List<Expression> UUIDList = new ArrayList<Expression>();
- UUIDList.add(new LiteralExpr(new StringLiteral(subscriptionId)));
- FunctionIdentifier function = AsterixBuiltinFunctions.UUID_CONSTRUCTOR;
- FunctionSignature UUIDfunc = new FunctionSignature(function.getNamespace(), function.getName(),
- function.getArity());
- CallExpr UUIDCall = new CallExpr(UUIDfunc, UUIDList);
-
- rightExpr = UUIDCall;
- fb.add(new FieldBinding(leftExpr, rightExpr));
- }
-
- for (int i = 0; i < argList.size(); i++) {
- leftExpr = new LiteralExpr(new StringLiteral("param" + i));
- rightExpr = argList.get(i);
- fb.add(new FieldBinding(leftExpr, rightExpr));
- }
- RecordConstructor recordCon = new RecordConstructor(fb);
- subscriptionTuple.setBody(recordCon);
-
- subscriptionTuple.setVarCounter(varCounter);
-
- if (subscriptionId == null) {
- InsertStatement insert = new InsertStatement(dataverseName, new Identifier(subscriptionsDatasetName),
- subscriptionTuple, varCounter, false, returnField);
- ((QueryTranslator) statementExecutor).handleInsertUpsertStatement(metadataProvider, insert, hcc, hdc,
- resultDelivery, stats, false);
- } else {
- UpsertStatement upsert = new UpsertStatement(dataverseName, new Identifier(subscriptionsDatasetName),
- subscriptionTuple, varCounter);
- ((QueryTranslator) statementExecutor).handleInsertUpsertStatement(metadataProvider, upsert, hcc, hdc,
- resultDelivery, stats, false);
- }
-
- MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
- } catch (Exception e) {
- QueryTranslator.abort(e, e, mdTxnCtx);
- throw new HyracksDataException(e);
- }
-
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/src/main/java/org/apache/asterix/bad/lang/statement/ChannelUnsubscribeStatement.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/asterix/bad/lang/statement/ChannelUnsubscribeStatement.java b/src/main/java/org/apache/asterix/bad/lang/statement/ChannelUnsubscribeStatement.java
deleted file mode 100644
index 17e3ad2..0000000
--- a/src/main/java/org/apache/asterix/bad/lang/statement/ChannelUnsubscribeStatement.java
+++ /dev/null
@@ -1,154 +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.
- */
-package org.apache.asterix.bad.lang.statement;
-
-import java.util.List;
-
-import org.apache.asterix.algebra.extension.IExtensionStatement;
-import org.apache.asterix.common.exceptions.AsterixException;
-import org.apache.asterix.lang.common.expression.VariableExpr;
-import org.apache.asterix.lang.common.struct.Identifier;
-import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
-import org.apache.asterix.metadata.declared.AqlMetadataProvider;
-import org.apache.asterix.translator.IStatementExecutor;
-import org.apache.asterix.translator.IStatementExecutor.ResultDelivery;
-import org.apache.asterix.translator.IStatementExecutor.Stats;
-import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
-import org.apache.hyracks.api.client.IHyracksClientConnection;
-import org.apache.hyracks.api.dataset.IHyracksDataset;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-
-public class ChannelUnsubscribeStatement implements IExtensionStatement {
-
- private final Identifier dataverseName;
- private final Identifier channelName;
- private final String subscriptionId;
- private final int varCounter;
- private VariableExpr vars;
- private List<String> dataverses;
- private List<String> datasets;
-
- public ChannelUnsubscribeStatement(VariableExpr vars, Identifier dataverseName, Identifier channelName,
- String subscriptionId, int varCounter, List<String> dataverses, List<String> datasets) {
- this.vars = vars;
- this.channelName = channelName;
- this.dataverseName = dataverseName;
- this.subscriptionId = subscriptionId;
- this.varCounter = varCounter;
- this.dataverses = dataverses;
- this.datasets = datasets;
- }
-
- public Identifier getDataverseName() {
- return dataverseName;
- }
-
- public VariableExpr getVariableExpr() {
- return vars;
- }
-
- public Identifier getChannelName() {
- return channelName;
- }
-
- public String getsubScriptionId() {
- return subscriptionId;
- }
-
- public List<String> getDataverses() {
- return dataverses;
- }
-
- public List<String> getDatasets() {
- return datasets;
- }
-
- public int getVarCounter() {
- return varCounter;
- }
-
- @Override
- public byte getKind() {
- return Kind.EXTENSION;
- }
-
- @Override
- public byte getCategory() {
- return Category.UPDATE;
- }
-
- @Override
- public <R, T> R accept(ILangVisitor<R, T> visitor, T arg) throws AsterixException {
- return null;
- }
-
- @Override
- public void handle(IStatementExecutor statementExecutor, AqlMetadataProvider metadataProvider,
- IHyracksClientConnection hcc, IHyracksDataset hdc, ResultDelivery resultDelivery, Stats stats)
- throws HyracksDataException, AlgebricksException {
- /* ChannelUnsubscribeStatement stmtChannelSub = (ChannelUnsubscribeStatement) stmt;
- String dataverseName = getActiveDataverse(stmtChannelSub.getDataverseName());
- Identifier channelName = stmtChannelSub.getChannelName();
- MetadataTransactionContext mdTxnCtx = MetadataManager.INSTANCE.beginTransaction();
- metadataProvider.setMetadataTxnContext(mdTxnCtx);
- MetadataLockManager.INSTANCE.readChannelBegin(dataverseName, dataverseName + "." + channelName);
- try {
- Channel channel = MetadataManager.INSTANCE.getChannel(mdTxnCtx, dataverseName, channelName.getValue());
- if (channel == null) {
- throw new AsterixException("There is no channel with this name " + channelName + ".");
- }
- Identifier subscriptionsDatasetName = new Identifier(channel.getSubscriptionsDataset());
-
- VariableExpr vars = stmtChannelSub.getVariableExpr();
-
- //Need a condition to say subscription-id = sid
- OperatorExpr condition = new OperatorExpr();
- FieldAccessor fa = new FieldAccessor(vars, new Identifier(ActiveConstants.SubscriptionId));
- condition.addOperand(fa);
- condition.setCurrentop(true);
- condition.addOperator("=");
-
- String sid = stmtChannelSub.getsubScriptionId();
- List<Expression> UUIDList = new ArrayList<Expression>();
- UUIDList.add(new LiteralExpr(new StringLiteral(sid)));
-
- FunctionIdentifier function = AsterixBuiltinFunctions.UUID_CONSTRUCTOR;
- FunctionSignature UUIDfunc = new FunctionSignature(function.getNamespace(), function.getName(),
- function.getArity());
- CallExpr UUIDCall = new CallExpr(UUIDfunc, UUIDList);
-
- condition.addOperand(UUIDCall);
-
- DeleteStatement delete = new DeleteStatement(vars, new Identifier(dataverseName), subscriptionsDatasetName,
- condition, stmtChannelSub.getVarCounter(), stmtChannelSub.getDataverses(),
- stmtChannelSub.getDatasets());
- AqlDeleteRewriteVisitor visitor = new AqlDeleteRewriteVisitor();
- delete.accept(visitor, null);
-
- handleDeleteStatement(metadataProvider, delete, hcc);
- MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
-
- } catch (Exception e) {
- abort(e, e, mdTxnCtx);
- throw e;
- } finally {
- MetadataLockManager.INSTANCE.readChannelEnd(dataverseName, dataverseName + "." + channelName);
- }*/
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/0921e3c9/src/main/java/org/apache/asterix/bad/lang/statement/CreateBrokerStatement.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/asterix/bad/lang/statement/CreateBrokerStatement.java b/src/main/java/org/apache/asterix/bad/lang/statement/CreateBrokerStatement.java
deleted file mode 100644
index 5b480ae..0000000
--- a/src/main/java/org/apache/asterix/bad/lang/statement/CreateBrokerStatement.java
+++ /dev/null
@@ -1,105 +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.
- */
-package org.apache.asterix.bad.lang.statement;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.asterix.algebra.extension.IExtensionStatement;
-import org.apache.asterix.app.translator.QueryTranslator;
-import org.apache.asterix.bad.lang.BADLangExtension;
-import org.apache.asterix.bad.metadata.Broker;
-import org.apache.asterix.common.exceptions.AsterixException;
-import org.apache.asterix.lang.common.struct.Identifier;
-import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
-import org.apache.asterix.metadata.MetadataManager;
-import org.apache.asterix.metadata.MetadataTransactionContext;
-import org.apache.asterix.metadata.declared.AqlMetadataProvider;
-import org.apache.asterix.translator.IStatementExecutor;
-import org.apache.asterix.translator.IStatementExecutor.ResultDelivery;
-import org.apache.asterix.translator.IStatementExecutor.Stats;
-import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
-import org.apache.hyracks.api.client.IHyracksClientConnection;
-import org.apache.hyracks.api.dataset.IHyracksDataset;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-
-public class CreateBrokerStatement implements IExtensionStatement {
-
- private static final Logger LOGGER = Logger.getLogger(CreateBrokerStatement.class.getName());
- private final Identifier dataverseName;
- private final Identifier brokerName;
- private String endPointName;
-
- public CreateBrokerStatement(Identifier dataverseName, Identifier brokerName, String endPointName) {
- this.brokerName = brokerName;
- this.dataverseName = dataverseName;
- this.endPointName = endPointName;
- }
-
- public String getEndPointName() {
- return endPointName;
- }
-
- public Identifier getDataverseName() {
- return dataverseName;
- }
-
- public Identifier getBrokerName() {
- return brokerName;
- }
-
- @Override
- public byte getKind() {
- return Kind.EXTENSION;
- }
-
- @Override
- public byte getCategory() {
- return Category.DDL;
- }
-
- @Override
- public <R, T> R accept(ILangVisitor<R, T> visitor, T arg) throws AsterixException {
- return null;
- }
-
- @Override
- public void handle(IStatementExecutor statementExecutor, AqlMetadataProvider metadataProvider,
- IHyracksClientConnection hcc, IHyracksDataset hdc, ResultDelivery resultDelivery, Stats stats)
- throws HyracksDataException, AlgebricksException {
- MetadataTransactionContext mdTxnCtx = null;
- try {
- mdTxnCtx = MetadataManager.INSTANCE.beginTransaction();
- metadataProvider.setMetadataTxnContext(mdTxnCtx);
- Broker broker = BADLangExtension.getBroker(mdTxnCtx, dataverseName.getValue(), brokerName.getValue());
- if (broker != null) {
- throw new AlgebricksException("A broker with this name " + brokerName + " already exists.");
- }
- broker = new Broker(dataverseName.getValue(), brokerName.getValue(), endPointName);
- MetadataManager.INSTANCE.addEntity(mdTxnCtx, broker);
- MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
- } catch (Exception e) {
- if (mdTxnCtx != null) {
- QueryTranslator.abort(e, e, mdTxnCtx);
- }
- LOGGER.log(Level.WARNING, "Failed creating a broker", e);
- throw new HyracksDataException(e);
- }
- }
-}
\ No newline at end of file