Merge commit '104d934' from 'gerrit/mad-hatter'
Change-Id: I6dcb1c3eb8ba53001f2a2b909f0cd49cdfc73a80
diff --git a/.gitignore b/.gitignore
index 1dcc3c2..295d874 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,5 +27,3 @@
*.swp
.m2*
ß
-
-.SpiderSilkWorkingDirectory
diff --git a/asterixdb/asterix-spidersilk/config/cc.conf b/asterixdb/asterix-spidersilk/config/cc.conf
deleted file mode 100644
index 3212003..0000000
--- a/asterixdb/asterix-spidersilk/config/cc.conf
+++ /dev/null
@@ -1,35 +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.
-
-[nc/nc1]
-txn.log.dir=/data/txnlog
-core.dump.dir=/data/coredump
-iodevices=/data
-address=nc1
-
-[nc/nc2]
-txn.log.dir=/data/txnlog
-core.dump.dir=/data/coredump
-iodevices=/data
-address=nc2
-
-[nc]
-app.class=org.apache.asterix.hyracks.bootstrap.NCApplicationEntryPoint
-command=asterixnc
-
-[cc]
-address=cc
\ No newline at end of file
diff --git a/asterixdb/asterix-spidersilk/docker/Dockerfile b/asterixdb/asterix-spidersilk/docker/Dockerfile
deleted file mode 100644
index b25561a..0000000
--- a/asterixdb/asterix-spidersilk/docker/Dockerfile
+++ /dev/null
@@ -1,22 +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.
-
-FROM centos:7
-
-USER root
-
-RUN yum install -y unzip git which docker-client java-1.8.0-openjdk-headless
diff --git a/asterixdb/asterix-spidersilk/pom.xml b/asterixdb/asterix-spidersilk/pom.xml
index 6b370c8..c58ee4f 100644
--- a/asterixdb/asterix-spidersilk/pom.xml
+++ b/asterixdb/asterix-spidersilk/pom.xml
@@ -35,91 +35,4 @@
<comments>A business-friendly OSS license</comments>
</license>
</licenses>
-
- <properties>
- <root.dir>${basedir}/..</root.dir>
- </properties>
-
- <repositories>
- <repository>
- <id>snapshots-repo</id>
- <url>https://oss.sonatype.org/content/repositories/snapshots</url>
- <releases><enabled>false</enabled></releases>
- <snapshots><enabled>true</enabled></snapshots>
- </repository>
- </repositories>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.12</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>me.arminb.spidersilk</groupId>
- <artifactId>spidersilk</artifactId>
- <version>0.4.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.7.25</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>2.9.7</version>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <version>1.2.3</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.asterix</groupId>
- <artifactId>asterix-app</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.asterix</groupId>
- <artifactId>asterix-test-framework</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.asterix</groupId>
- <artifactId>asterix-app</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.asterix</groupId>
- <artifactId>asterix-server</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- </dependencies>
-
- <!-- While these dependencies are declared and being used, the maven dependency plugin detects them as declared and
- not used. To make this right, it is needed to force these dependencies as used -->
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <configuration>
- <usedDependencies>
- <usedDependency>ch.qos.logback:logback-classic</usedDependency>
- <usedDependency>org.apache.asterix:asterix-app</usedDependency>
- <usedDependency>org.apache.asterix:asterix-server</usedDependency>
- </usedDependencies>
- </configuration>
- </plugin>
- </plugins>
- </build>
</project>
diff --git a/asterixdb/asterix-spidersilk/src/test/java/org/apache/asterix/spidersilk/SampleTestIT.java b/asterixdb/asterix-spidersilk/src/test/java/org/apache/asterix/spidersilk/SampleTestIT.java
deleted file mode 100644
index 07c0fc6..0000000
--- a/asterixdb/asterix-spidersilk/src/test/java/org/apache/asterix/spidersilk/SampleTestIT.java
+++ /dev/null
@@ -1,92 +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.spidersilk;
-
-import java.io.InputStream;
-
-import org.apache.asterix.test.common.TestExecutor;
-import org.apache.asterix.testframework.context.TestCaseContext;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.MappingIterator;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.ObjectReader;
-
-import me.arminb.spidersilk.SpiderSilkRunner;
-import me.arminb.spidersilk.dsl.entities.Deployment;
-import me.arminb.spidersilk.exceptions.RuntimeEngineException;
-
-public class SampleTestIT {
- private static final Logger logger = LoggerFactory.getLogger(SampleTestIT.class);
-
- protected static SpiderSilkRunner runner;
-
- @BeforeClass
- public static void before() throws RuntimeEngineException {
- Deployment deployment = TestUtil.getSimpleClusterDeployment();
- runner = SpiderSilkRunner.run(deployment);
- TestUtil.waitForClusterToBeUp(runner);
- logger.info("The cluster is UP!");
- }
-
- @AfterClass
- public static void after() {
- if (runner != null) {
- runner.stop();
- }
- }
-
- @Test
- public void sampleTest() throws Exception {
-
- TestExecutor testExecutor = TestUtil.getTestExecutor(runner);
- String ddl = "drop dataverse company if exists;" + "create dataverse company;" + "use company;"
- + "create type Emp as open {" + " id : int32," + " name : string" + "};"
- + "create dataset Employee(Emp) primary key id;";
-
- String insertStatements = "use company;" + "insert into Employee({ \"id\":123,\"name\":\"John Doe\"});";
-
- String query = "use company;" + "select value emp from Employee emp;";
-
- testExecutor.executeSqlppUpdateOrDdl(ddl, TestCaseContext.OutputFormat.CLEAN_JSON);
- logger.info("Company dataverse and employee dataset are created!");
- testExecutor.executeSqlppUpdateOrDdl(insertStatements, TestCaseContext.OutputFormat.CLEAN_JSON);
- logger.info("A record is inserted into employee dataset");
- InputStream resultStream = testExecutor.executeSqlppUpdateOrDdl(query, TestCaseContext.OutputFormat.CLEAN_JSON);
-
- ObjectMapper objectMapper = new ObjectMapper();
- ObjectReader objectReader = objectMapper.readerFor(JsonNode.class);
- MappingIterator<JsonNode> jsonIterator = objectReader.readValues(resultStream);
- int size = 0;
- while (jsonIterator.hasNext()) {
- size++;
- JsonNode result = jsonIterator.next();
- Assert.assertEquals(1, size);
- Assert.assertEquals(123, result.get("id").asInt());
- Assert.assertEquals("John Doe", result.get("name").asText());
- }
- logger.info("The fetched record matches the inserted record");
- }
-}
diff --git a/asterixdb/asterix-spidersilk/src/test/java/org/apache/asterix/spidersilk/TestUtil.java b/asterixdb/asterix-spidersilk/src/test/java/org/apache/asterix/spidersilk/TestUtil.java
deleted file mode 100644
index 03e8191..0000000
--- a/asterixdb/asterix-spidersilk/src/test/java/org/apache/asterix/spidersilk/TestUtil.java
+++ /dev/null
@@ -1,74 +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.spidersilk;
-
-import java.io.File;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.stream.Stream;
-
-import org.apache.asterix.test.common.TestExecutor;
-
-import me.arminb.spidersilk.SpiderSilkRunner;
-import me.arminb.spidersilk.dsl.entities.Deployment;
-import me.arminb.spidersilk.dsl.entities.PortType;
-import me.arminb.spidersilk.dsl.entities.ServiceType;
-import me.arminb.spidersilk.exceptions.RuntimeEngineException;
-
-public class TestUtil {
- private static String mavenVersion;
- private static String asterixHome;
-
- public static Deployment getSimpleClusterDeployment() {
- mavenVersion = getMavenArtifactVersion();
- asterixHome = "/asterix/apache-asterixdb-" + mavenVersion;
-
- return new Deployment.DeploymentBuilder("simpleClusterDeployment")
- // Service Definitions
- .withService("asterix")
- .applicationPath("../asterix-server/target/asterix-server-" + mavenVersion + "-binary-assembly.zip",
- "/asterix", false, true, false)
- .dockerFileAddress("docker/Dockerfile", false).dockerImage("spidersilk/test-asterix")
- .instrumentablePath(asterixHome + "/repo/asterix-server-" + mavenVersion + ".jar")
- .libraryPath(asterixHome + "/repo/*.jar").libraryPath(asterixHome + "/lib/*.jar")
- .logDirectory(asterixHome + "/logs").serviceType(ServiceType.JAVA).and()
- // Node Definitions
- .withNode("cc", "asterix").applicationPath("config", "/asterix/config")
- .startCommand(asterixHome + "/bin/asterixcc -config-file /asterix/config/cc.conf").tcpPort(19002).and()
- .withNode("nc1", "asterix").startCommand(asterixHome + "/bin/asterixncservice").and()
- .withNode("nc2", "asterix").startCommand(asterixHome + "/bin/asterixncservice").and().build();
- }
-
- public static String getMavenArtifactVersion() {
- Optional<String> version = Stream
- .of(Objects.requireNonNull(new File("../asterix-server/target")
- .list((dir, name) -> name.matches("asterix-server-.*-binary-assembly.zip"))))
- .map(foo -> foo.replace("asterix-server-", "")).map(foo -> foo.replace("-binary-assembly.zip", ""))
- .findFirst();
- return version.orElseThrow(IllegalStateException::new);
- }
-
- public static void waitForClusterToBeUp(SpiderSilkRunner runner) throws RuntimeEngineException {
- runner.runtime().runCommandInNode("cc", asterixHome + "/bin/asterixhelper wait_for_cluster");
- }
-
- public static TestExecutor getTestExecutor(SpiderSilkRunner runner) {
- return new TestExecutor(runner.runtime().ip("cc"), runner.runtime().portMapping("cc", 19002, PortType.TCP));
- }
-}
diff --git a/asterixdb/asterix-spidersilk/src/test/resources/logback.xml b/asterixdb/asterix-spidersilk/src/test/resources/logback.xml
deleted file mode 100644
index ca7aa79..0000000
--- a/asterixdb/asterix-spidersilk/src/test/resources/logback.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ 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.
- -->
-
-<configuration>
-
- <appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
- <layout class="ch.qos.logback.classic.PatternLayout">
- <Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
- </layout>
- </appender>
-
- <logger name="me.arminb" level="DEBUG"/>
- <logger name="org.apache.asterix" level="DEBUG"/>
-
- <root level="ERROR">
- <appender-ref ref="Console" />
- </root>
-</configuration>
diff --git a/asterixdb/pom.xml b/asterixdb/pom.xml
index 7d58b73..ece4b12 100644
--- a/asterixdb/pom.xml
+++ b/asterixdb/pom.xml
@@ -197,7 +197,6 @@
<exclude>**/*.json</exclude>
<exclude>**/*.adm</exclude>
<exclude>**/*.template</exclude>
- <exclude>**/.SpiderSilkWorkingDirectory/**</exclude>
<exclude>asterix-installer/**</exclude> <!-- in case -DskipInstaller -->
</excludes>
</configuration>