You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by im...@apache.org on 2016/03/16 01:35:16 UTC
[11/15] incubator-asterixdb git commit: Merge asterix-experiments to
master
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment2ShbtreeBuilder.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment2ShbtreeBuilder.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment2ShbtreeBuilder.java
new file mode 100644
index 0000000..ec08453
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment2ShbtreeBuilder.java
@@ -0,0 +1,38 @@
+/*
+ * 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.experiment.builder;
+
+import org.apache.asterix.experiment.action.base.SequentialActionList;
+import org.apache.asterix.experiment.action.derived.RunAQLFileAction;
+import org.apache.asterix.experiment.client.LSMExperimentConstants;
+import org.apache.asterix.experiment.client.LSMExperimentSetRunner.LSMExperimentSetRunnerConfig;
+
+public class SpatialIndexExperiment2ShbtreeBuilder extends AbstractSpatialIndexExperiment2Builder {
+
+ public SpatialIndexExperiment2ShbtreeBuilder(LSMExperimentSetRunnerConfig config) {
+ super("SpatialIndexExperiment2Shbtree", config, "1node.xml", "base_1_ingest_query.aql", "1.dgen", true);
+ }
+
+ @Override
+ protected void doBuildDDL(SequentialActionList seq) {
+ seq.add(new RunAQLFileAction(httpClient, restHost, restPort, localExperimentRoot.resolve(
+ LSMExperimentConstants.AQL_DIR).resolve("spatial_1_shbtree.aql")));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment2SifBuilder.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment2SifBuilder.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment2SifBuilder.java
new file mode 100644
index 0000000..79353dc
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment2SifBuilder.java
@@ -0,0 +1,38 @@
+/*
+ * 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.experiment.builder;
+
+import org.apache.asterix.experiment.action.base.SequentialActionList;
+import org.apache.asterix.experiment.action.derived.RunAQLFileAction;
+import org.apache.asterix.experiment.client.LSMExperimentConstants;
+import org.apache.asterix.experiment.client.LSMExperimentSetRunner.LSMExperimentSetRunnerConfig;
+
+public class SpatialIndexExperiment2SifBuilder extends AbstractSpatialIndexExperiment2Builder {
+
+ public SpatialIndexExperiment2SifBuilder(LSMExperimentSetRunnerConfig config) {
+ super("SpatialIndexExperiment2Sif", config, "1node.xml", "base_1_ingest_query.aql", "1.dgen", true);
+ }
+
+ @Override
+ protected void doBuildDDL(SequentialActionList seq) {
+ seq.add(new RunAQLFileAction(httpClient, restHost, restPort, localExperimentRoot.resolve(
+ LSMExperimentConstants.AQL_DIR).resolve("spatial_1_sif.aql")));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3DhbtreeBuilder.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3DhbtreeBuilder.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3DhbtreeBuilder.java
new file mode 100644
index 0000000..4a6718f
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3DhbtreeBuilder.java
@@ -0,0 +1,30 @@
+/*
+ * 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.experiment.builder;
+
+import org.apache.asterix.experiment.client.LSMExperimentSetRunner.LSMExperimentSetRunnerConfig;
+
+public class SpatialIndexExperiment3DhbtreeBuilder extends AbstractSpatialIndexExperiment3SIdxCreateAndQueryBuilder {
+
+ public SpatialIndexExperiment3DhbtreeBuilder(LSMExperimentSetRunnerConfig config) {
+ super("SpatialIndexExperiment3Dhbtree", config, "1node.xml", "base_1_ingest.aql", "1.dqgen", "count.aql",
+ "spatial_3_create_dhbtree.aql", true);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3DhvbtreeBuilder.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3DhvbtreeBuilder.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3DhvbtreeBuilder.java
new file mode 100644
index 0000000..58cc03f
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3DhvbtreeBuilder.java
@@ -0,0 +1,30 @@
+/*
+ * 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.experiment.builder;
+
+import org.apache.asterix.experiment.client.LSMExperimentSetRunner.LSMExperimentSetRunnerConfig;
+
+public class SpatialIndexExperiment3DhvbtreeBuilder extends AbstractSpatialIndexExperiment3SIdxCreateAndQueryBuilder {
+
+ public SpatialIndexExperiment3DhvbtreeBuilder(LSMExperimentSetRunnerConfig config) {
+ super("SpatialIndexExperiment3Dhvbtree", config, "8node.xml", "base_8_ingest.aql", "8.dqgen", "count.aql",
+ "spatial_3_create_dhvbtree.aql", true);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3PIdxLoadBuilder.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3PIdxLoadBuilder.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3PIdxLoadBuilder.java
new file mode 100644
index 0000000..fbc63ac
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3PIdxLoadBuilder.java
@@ -0,0 +1,39 @@
+/*
+ * 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.experiment.builder;
+
+import org.apache.asterix.experiment.action.base.SequentialActionList;
+import org.apache.asterix.experiment.action.derived.RunAQLFileAction;
+import org.apache.asterix.experiment.client.LSMExperimentConstants;
+import org.apache.asterix.experiment.client.LSMExperimentSetRunner.LSMExperimentSetRunnerConfig;
+
+public class SpatialIndexExperiment3PIdxLoadBuilder extends AbstractSpatialIndexExperiment3PIdxLoadBuilder {
+
+ public SpatialIndexExperiment3PIdxLoadBuilder(LSMExperimentSetRunnerConfig config) {
+ super("SpatialIndexExperiment3PIdxLoad", config, "8node.xml", "base_8_ingest.aql", "8.dqgen", "count.aql", "spatial_3_pidx_load.aql");
+ }
+
+ @Override
+ protected void doBuildDDL(SequentialActionList seq) {
+ seq.add(new RunAQLFileAction(httpClient, restHost, restPort, localExperimentRoot.resolve(
+ LSMExperimentConstants.AQL_DIR).resolve("spatial_3.aql")));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3RtreeBuilder.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3RtreeBuilder.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3RtreeBuilder.java
new file mode 100644
index 0000000..bcf5f8c
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3RtreeBuilder.java
@@ -0,0 +1,30 @@
+/*
+ * 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.experiment.builder;
+
+import org.apache.asterix.experiment.client.LSMExperimentSetRunner.LSMExperimentSetRunnerConfig;
+
+public class SpatialIndexExperiment3RtreeBuilder extends AbstractSpatialIndexExperiment3SIdxCreateAndQueryBuilder {
+
+ public SpatialIndexExperiment3RtreeBuilder(LSMExperimentSetRunnerConfig config) {
+ super("SpatialIndexExperiment3Rtree", config, "8node.xml", "base_8_ingest.aql", "8.dqgen", "count.aql",
+ "spatial_3_create_rtree.aql", true);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3ShbtreeBuilder.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3ShbtreeBuilder.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3ShbtreeBuilder.java
new file mode 100644
index 0000000..7b33ed7
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3ShbtreeBuilder.java
@@ -0,0 +1,30 @@
+/*
+ * 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.experiment.builder;
+
+import org.apache.asterix.experiment.client.LSMExperimentSetRunner.LSMExperimentSetRunnerConfig;
+
+public class SpatialIndexExperiment3ShbtreeBuilder extends AbstractSpatialIndexExperiment3SIdxCreateAndQueryBuilder {
+
+ public SpatialIndexExperiment3ShbtreeBuilder(LSMExperimentSetRunnerConfig config) {
+ super("SpatialIndexExperiment3Shbtree", config, "8node.xml", "base_8_ingest.aql", "8.dqgen", "count.aql",
+ "spatial_3_create_shbtree.aql", true);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3SifBuilder.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3SifBuilder.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3SifBuilder.java
new file mode 100644
index 0000000..75a50c5
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment3SifBuilder.java
@@ -0,0 +1,30 @@
+/*
+ * 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.experiment.builder;
+
+import org.apache.asterix.experiment.client.LSMExperimentSetRunner.LSMExperimentSetRunnerConfig;
+
+public class SpatialIndexExperiment3SifBuilder extends AbstractSpatialIndexExperiment3SIdxCreateAndQueryBuilder {
+
+ public SpatialIndexExperiment3SifBuilder(LSMExperimentSetRunnerConfig config) {
+ super("SpatialIndexExperiment3Sif", config, "8node.xml", "base_8_ingest.aql", "8.dqgen", "count.aql",
+ "spatial_3_create_sif.aql", true);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment4DhbtreeBuilder.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment4DhbtreeBuilder.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment4DhbtreeBuilder.java
new file mode 100644
index 0000000..1fac7d0
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment4DhbtreeBuilder.java
@@ -0,0 +1,31 @@
+/*
+ * 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.experiment.builder;
+
+import org.apache.asterix.experiment.client.LSMExperimentSetRunner.LSMExperimentSetRunnerConfig;
+
+public class SpatialIndexExperiment4DhbtreeBuilder extends AbstractSpatialIndexExperiment3SIdxCreateAndQueryBuilder {
+
+ //SpatialIndexExperiment4XXX is exactly the same as SpatialIndexExperiment3XXX except queries are non-index only plan queries.
+ public SpatialIndexExperiment4DhbtreeBuilder(LSMExperimentSetRunnerConfig config) {
+ super("SpatialIndexExperiment4Dhbtree", config, "8node.xml", "base_8_ingest.aql", "8.dqgen", "count.aql",
+ "spatial_3_create_dhbtree.aql", false);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment4DhvbtreeBuilder.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment4DhvbtreeBuilder.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment4DhvbtreeBuilder.java
new file mode 100644
index 0000000..1579be0
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment4DhvbtreeBuilder.java
@@ -0,0 +1,31 @@
+/*
+ * 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.experiment.builder;
+
+import org.apache.asterix.experiment.client.LSMExperimentSetRunner.LSMExperimentSetRunnerConfig;
+
+public class SpatialIndexExperiment4DhvbtreeBuilder extends AbstractSpatialIndexExperiment3SIdxCreateAndQueryBuilder {
+
+ //SpatialIndexExperiment4XXX is exactly the same as SpatialIndexExperiment3XXX except queries are non-index only plan queries.
+ public SpatialIndexExperiment4DhvbtreeBuilder(LSMExperimentSetRunnerConfig config) {
+ super("SpatialIndexExperiment4Dhvbtree", config, "8node.xml", "base_8_ingest.aql", "8.dqgen", "count.aql",
+ "spatial_3_create_dhvbtree.aql", false);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment4RtreeBuilder.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment4RtreeBuilder.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment4RtreeBuilder.java
new file mode 100644
index 0000000..54cd9cc
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment4RtreeBuilder.java
@@ -0,0 +1,31 @@
+/*
+ * 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.experiment.builder;
+
+import org.apache.asterix.experiment.client.LSMExperimentSetRunner.LSMExperimentSetRunnerConfig;
+
+public class SpatialIndexExperiment4RtreeBuilder extends AbstractSpatialIndexExperiment3SIdxCreateAndQueryBuilder {
+
+ //SpatialIndexExperiment4XXX is exactly the same as SpatialIndexExperiment3XXX except queries are non-index only plan queries.
+ public SpatialIndexExperiment4RtreeBuilder(LSMExperimentSetRunnerConfig config) {
+ super("SpatialIndexExperiment4Rtree", config, "8node.xml", "base_8_ingest.aql", "8.dqgen", "count.aql",
+ "spatial_3_create_rtree.aql", false);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment4ShbtreeBuilder.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment4ShbtreeBuilder.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment4ShbtreeBuilder.java
new file mode 100644
index 0000000..91eef5e
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment4ShbtreeBuilder.java
@@ -0,0 +1,31 @@
+/*
+ * 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.experiment.builder;
+
+import org.apache.asterix.experiment.client.LSMExperimentSetRunner.LSMExperimentSetRunnerConfig;
+
+public class SpatialIndexExperiment4ShbtreeBuilder extends AbstractSpatialIndexExperiment3SIdxCreateAndQueryBuilder {
+
+ //SpatialIndexExperiment4XXX is exactly the same as SpatialIndexExperiment3XXX except queries are non-index only plan queries.
+ public SpatialIndexExperiment4ShbtreeBuilder(LSMExperimentSetRunnerConfig config) {
+ super("SpatialIndexExperiment4Shbtree", config, "8node.xml", "base_8_ingest.aql", "8.dqgen", "count.aql",
+ "spatial_3_create_shbtree.aql", false);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment4SifBuilder.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment4SifBuilder.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment4SifBuilder.java
new file mode 100644
index 0000000..9043c5f
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment4SifBuilder.java
@@ -0,0 +1,31 @@
+/*
+ * 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.experiment.builder;
+
+import org.apache.asterix.experiment.client.LSMExperimentSetRunner.LSMExperimentSetRunnerConfig;
+
+public class SpatialIndexExperiment4SifBuilder extends AbstractSpatialIndexExperiment3SIdxCreateAndQueryBuilder {
+
+ //SpatialIndexExperiment4XXX is exactly the same as SpatialIndexExperiment3XXX except queries are non-index only plan queries.
+ public SpatialIndexExperiment4SifBuilder(LSMExperimentSetRunnerConfig config) {
+ super("SpatialIndexExperiment4Sif", config, "8node.xml", "base_8_ingest.aql", "8.dqgen", "count.aql",
+ "spatial_3_create_sif.aql", false);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment5DhbtreeBuilder.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment5DhbtreeBuilder.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment5DhbtreeBuilder.java
new file mode 100644
index 0000000..74b00f3
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment5DhbtreeBuilder.java
@@ -0,0 +1,39 @@
+/*
+ * 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.experiment.builder;
+
+import org.apache.asterix.experiment.action.base.SequentialActionList;
+import org.apache.asterix.experiment.action.derived.RunAQLFileAction;
+import org.apache.asterix.experiment.client.LSMExperimentConstants;
+import org.apache.asterix.experiment.client.LSMExperimentSetRunner.LSMExperimentSetRunnerConfig;
+
+public class SpatialIndexExperiment5DhbtreeBuilder extends AbstractSpatialIndexExperiment2Builder {
+
+ //SpatialIndexExperiment5XXX is exactly the same as SpatialIndexExperiment2XXX except queries are non-index only plan queries.
+ public SpatialIndexExperiment5DhbtreeBuilder(LSMExperimentSetRunnerConfig config) {
+ super("SpatialIndexExperiment5Dhbtree", config, "1node.xml", "base_1_ingest_query.aql", "1.dgen", false);
+ }
+
+ @Override
+ protected void doBuildDDL(SequentialActionList seq) {
+ seq.add(new RunAQLFileAction(httpClient, restHost, restPort, localExperimentRoot.resolve(
+ LSMExperimentConstants.AQL_DIR).resolve("spatial_1_dhbtree.aql")));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment5DhvbtreeBuilder.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment5DhvbtreeBuilder.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment5DhvbtreeBuilder.java
new file mode 100644
index 0000000..b665d1b
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment5DhvbtreeBuilder.java
@@ -0,0 +1,39 @@
+/*
+ * 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.experiment.builder;
+
+import org.apache.asterix.experiment.action.base.SequentialActionList;
+import org.apache.asterix.experiment.action.derived.RunAQLFileAction;
+import org.apache.asterix.experiment.client.LSMExperimentConstants;
+import org.apache.asterix.experiment.client.LSMExperimentSetRunner.LSMExperimentSetRunnerConfig;
+
+public class SpatialIndexExperiment5DhvbtreeBuilder extends AbstractSpatialIndexExperiment2Builder {
+
+ //SpatialIndexExperiment5XXX is exactly the same as SpatialIndexExperiment2XXX except queries are non-index only plan queries.
+ public SpatialIndexExperiment5DhvbtreeBuilder(LSMExperimentSetRunnerConfig config) {
+ super("SpatialIndexExperiment5Dhvbtree", config, "1node.xml", "base_1_ingest_query.aql", "1.dgen", false);
+ }
+
+ @Override
+ protected void doBuildDDL(SequentialActionList seq) {
+ seq.add(new RunAQLFileAction(httpClient, restHost, restPort, localExperimentRoot.resolve(
+ LSMExperimentConstants.AQL_DIR).resolve("spatial_1_dhvbtree.aql")));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment5RtreeBuilder.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment5RtreeBuilder.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment5RtreeBuilder.java
new file mode 100644
index 0000000..aca7c2b
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment5RtreeBuilder.java
@@ -0,0 +1,39 @@
+/*
+ * 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.experiment.builder;
+
+import org.apache.asterix.experiment.action.base.SequentialActionList;
+import org.apache.asterix.experiment.action.derived.RunAQLFileAction;
+import org.apache.asterix.experiment.client.LSMExperimentConstants;
+import org.apache.asterix.experiment.client.LSMExperimentSetRunner.LSMExperimentSetRunnerConfig;
+
+public class SpatialIndexExperiment5RtreeBuilder extends AbstractSpatialIndexExperiment2Builder {
+
+ //SpatialIndexExperiment5XXX is exactly the same as SpatialIndexExperiment2XXX except queries are non-index only plan queries.
+ public SpatialIndexExperiment5RtreeBuilder(LSMExperimentSetRunnerConfig config) {
+ super("SpatialIndexExperiment5Rtree", config, "1node.xml", "base_1_ingest_query.aql", "1.dgen", false);
+ }
+
+ @Override
+ protected void doBuildDDL(SequentialActionList seq) {
+ seq.add(new RunAQLFileAction(httpClient, restHost, restPort, localExperimentRoot.resolve(
+ LSMExperimentConstants.AQL_DIR).resolve("spatial_1_rtree.aql")));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment5ShbtreeBuilder.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment5ShbtreeBuilder.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment5ShbtreeBuilder.java
new file mode 100644
index 0000000..2c066fd
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment5ShbtreeBuilder.java
@@ -0,0 +1,39 @@
+/*
+ * 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.experiment.builder;
+
+import org.apache.asterix.experiment.action.base.SequentialActionList;
+import org.apache.asterix.experiment.action.derived.RunAQLFileAction;
+import org.apache.asterix.experiment.client.LSMExperimentConstants;
+import org.apache.asterix.experiment.client.LSMExperimentSetRunner.LSMExperimentSetRunnerConfig;
+
+public class SpatialIndexExperiment5ShbtreeBuilder extends AbstractSpatialIndexExperiment2Builder {
+
+ //SpatialIndexExperiment5XXX is exactly the same as SpatialIndexExperiment2XXX except queries are non-index only plan queries.
+ public SpatialIndexExperiment5ShbtreeBuilder(LSMExperimentSetRunnerConfig config) {
+ super("SpatialIndexExperiment5Shbtree", config, "1node.xml", "base_1_ingest_query.aql", "1.dgen", false);
+ }
+
+ @Override
+ protected void doBuildDDL(SequentialActionList seq) {
+ seq.add(new RunAQLFileAction(httpClient, restHost, restPort, localExperimentRoot.resolve(
+ LSMExperimentConstants.AQL_DIR).resolve("spatial_1_shbtree.aql")));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment5SifBuilder.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment5SifBuilder.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment5SifBuilder.java
new file mode 100644
index 0000000..4ee4095
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/SpatialIndexExperiment5SifBuilder.java
@@ -0,0 +1,39 @@
+/*
+ * 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.experiment.builder;
+
+import org.apache.asterix.experiment.action.base.SequentialActionList;
+import org.apache.asterix.experiment.action.derived.RunAQLFileAction;
+import org.apache.asterix.experiment.client.LSMExperimentConstants;
+import org.apache.asterix.experiment.client.LSMExperimentSetRunner.LSMExperimentSetRunnerConfig;
+
+public class SpatialIndexExperiment5SifBuilder extends AbstractSpatialIndexExperiment2Builder {
+
+ //SpatialIndexExperiment5XXX is exactly the same as SpatialIndexExperiment2XXX except queries are non-index only plan queries.
+ public SpatialIndexExperiment5SifBuilder(LSMExperimentSetRunnerConfig config) {
+ super("SpatialIndexExperiment5Sif", config, "1node.xml", "base_1_ingest_query.aql", "1.dgen", false);
+ }
+
+ @Override
+ protected void doBuildDDL(SequentialActionList seq) {
+ seq.add(new RunAQLFileAction(httpClient, restHost, restPort, localExperimentRoot.resolve(
+ LSMExperimentConstants.AQL_DIR).resolve("spatial_1_sif.aql")));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/LSMExperimentConstants.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/LSMExperimentConstants.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/LSMExperimentConstants.java
new file mode 100644
index 0000000..c0e6440
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/LSMExperimentConstants.java
@@ -0,0 +1,37 @@
+/*
+ * 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.experiment.client;
+
+public class LSMExperimentConstants {
+
+ public static final String CONFIG_DIR = "configs";
+
+ public static final String AQL_DIR = "aql";
+
+ public static final String BASE_DIR = "base";
+
+ public static final String DGEN_DIR = "dgen";
+
+ public static final String LOG_DIR = "log";
+
+ public static final String BASE_TYPES = "base/base_types.aql";
+
+ public static final String ASTERIX_CONFIGURATION = "asterix-configuration.xml";
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/LSMExperimentSetRunner.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/LSMExperimentSetRunner.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/LSMExperimentSetRunner.java
new file mode 100644
index 0000000..8b59449
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/LSMExperimentSetRunner.java
@@ -0,0 +1,381 @@
+/*
+ * 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.experiment.client;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.regex.Pattern;
+
+import org.apache.asterix.experiment.action.base.SequentialActionList;
+import org.apache.asterix.experiment.builder.AbstractExperimentBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment1ADhbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment1ADhvbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment1ARtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment1AShbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment1ASifBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment1BDhbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment1BDhvbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment1BRtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment1BShbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment1BSifBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment1CDhbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment1CDhvbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment1CRtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment1CShbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment1CSifBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment1DDhbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment1DDhvbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment1DRtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment1DShbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment1DSifBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment2DhbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment2DhvbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment2RtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment2ShbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment2SifBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment3DhbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment3DhvbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment3PIdxLoadBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment3RtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment3ShbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment3SifBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment4DhbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment4DhvbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment4RtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment4ShbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment4SifBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment5DhbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment5DhvbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment5RtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment5ShbtreeBuilder;
+import org.apache.asterix.experiment.builder.SpatialIndexExperiment5SifBuilder;
+import org.kohsuke.args4j.CmdLineException;
+import org.kohsuke.args4j.CmdLineParser;
+import org.kohsuke.args4j.Option;
+
+public class LSMExperimentSetRunner {
+
+ private static final Logger LOGGER = Logger.getLogger(LSMExperimentSetRunner.class.getName());
+
+ public static class LSMExperimentSetRunnerConfig {
+
+ private final String logDirSuffix;
+
+ private final int nQueryRuns;
+
+ public LSMExperimentSetRunnerConfig(String logDirSuffix, int nQueryRuns) {
+ this.logDirSuffix = logDirSuffix;
+ this.nQueryRuns = nQueryRuns;
+ }
+
+ public String getLogDirSuffix() {
+ return logDirSuffix;
+ }
+
+ public int getNQueryRuns() {
+ return nQueryRuns;
+ }
+
+ @Option(name = "-rh", aliases = "--rest-host", usage = "Asterix REST API host address", required = true, metaVar = "HOST")
+ private String restHost;
+
+ public String getRESTHost() {
+ return restHost;
+ }
+
+ @Option(name = "-rp", aliases = "--rest-port", usage = "Asterix REST API port", required = true, metaVar = "PORT")
+ private int restPort;
+
+ public int getRESTPort() {
+ return restPort;
+ }
+
+ @Option(name = "-mh", aliases = "--managix-home", usage = "Path to MANAGIX_HOME directory", required = true, metaVar = "MGXHOME")
+ private String managixHome;
+
+ public String getManagixHome() {
+ return managixHome;
+ }
+
+ @Option(name = "-jh", aliases = "--java-home", usage = "Path to JAVA_HOME directory", required = true, metaVar = "JAVAHOME")
+ private String javaHome;
+
+ public String getJavaHome() {
+ return javaHome;
+ }
+
+ @Option(name = "-ler", aliases = "--local-experiment-root", usage = "Path to the local LSM experiment root directory", required = true, metaVar = "LOCALEXPROOT")
+ private String localExperimentRoot;
+
+ public String getLocalExperimentRoot() {
+ return localExperimentRoot;
+ }
+
+ @Option(name = "-u", aliases = "--username", usage = "Username to use for SSH/SCP", required = true, metaVar = "UNAME")
+ private String username;
+
+ public String getUsername() {
+ return username;
+ }
+
+ @Option(name = "-k", aliases = "--key", usage = "SSH key location", metaVar = "SSHKEY")
+ private String sshKeyLocation;
+
+ public String getSSHKeyLocation() {
+ return sshKeyLocation;
+ }
+
+ @Option(name = "-d", aliases = "--datagen-duartion", usage = "Data generation duration in seconds", metaVar = "DATAGENDURATION")
+ private int duration;
+
+ public int getDuration() {
+ return duration;
+ }
+
+ @Option(name = "-qd", aliases = "--querygen-duartion", usage = "Query generation duration in seconds", metaVar = "QUERYGENDURATION")
+ private int queryDuration;
+
+ public int getQueryDuration() {
+ return queryDuration;
+ }
+
+ @Option(name = "-regex", aliases = "--regex", usage = "Regular expression used to match experiment names", metaVar = "REGEXP")
+ private String regex;
+
+ public String getRegex() {
+ return regex;
+ }
+
+ @Option(name = "-oh", aliases = "--orchestrator-host", usage = "The host address of THIS orchestrator")
+ private String orchHost;
+
+ public String getOrchestratorHost() {
+ return orchHost;
+ }
+
+ @Option(name = "-op", aliases = "--orchestrator-port", usage = "The port to be used for the orchestrator server of THIS orchestrator")
+ private int orchPort;
+
+ public int getOrchestratorPort() {
+ return orchPort;
+ }
+
+ @Option(name = "-qoh", aliases = "--query-orchestrator-host", usage = "The host address of query orchestrator")
+ private String queryOrchHost;
+
+ public String getQueryOrchestratorHost() {
+ return queryOrchHost;
+ }
+
+ @Option(name = "-qop", aliases = "--query-orchestrator-port", usage = "The port to be used for the orchestrator server of query orchestrator")
+ private int queryOrchPort;
+
+ public int getQueryOrchestratorPort() {
+ return queryOrchPort;
+ }
+
+ @Option(name = "-di", aliases = "--data-interval", usage = " Initial data interval to use when generating data for exp 7")
+ private long dataInterval;
+
+ public long getDataInterval() {
+ return dataInterval;
+ }
+
+ @Option(name = "-ni", aliases = "--num-data-intervals", usage = "Number of data intervals to use when generating data for exp 7")
+ private int numIntervals;
+
+ public int getNIntervals() {
+ return numIntervals;
+ }
+
+ @Option(name = "-sf", aliases = "--stat-file", usage = "Enable IO/CPU stats and place in specified file")
+ private String statFile = null;
+
+ public String getStatFile() {
+ return statFile;
+ }
+
+ @Option(name = "-of", aliases = "--openstreetmap-filepath", usage = "The open street map gps point data file path")
+ private String openStreetMapFilePath;
+
+ public String getOpenStreetMapFilePath() {
+ return openStreetMapFilePath;
+ }
+
+ @Option(name = "-si", aliases = "--location-sample-interval", usage = "Location sample interval from open street map point data")
+ private int locationSampleInterval;
+
+ public int getLocationSampleInterval() {
+ return locationSampleInterval;
+ }
+
+ @Option(name = "-qsf", aliases = "--query-seed-filepath", usage = "The query seed file path")
+ private String querySeedFilePath;
+
+ public String getQuerySeedFilePath() {
+ return querySeedFilePath;
+ }
+
+ @Option(name = "-rcbi", aliases = "--record-count-per-batch-during-ingestion-only", usage = "Record count per batch during ingestion only")
+ private int recordCountPerBatchDuringIngestionOnly = 1000;
+
+ public int getRecordCountPerBatchDuringIngestionOnly() {
+ return recordCountPerBatchDuringIngestionOnly;
+ }
+
+ @Option(name = "-rcbq", aliases = "--record-count-per-batch-during-query", usage = "Record count per batch during query")
+ private int recordCountPerBatchDuringQuery = 1000;
+
+ public int getRecordCountPerBatchDuringQuery() {
+ return recordCountPerBatchDuringQuery;
+ }
+
+ @Option(name = "-dsti", aliases = "--data-gen-sleep-time-during-ingestion-only", usage = "DataGen sleep time in milliseconds after every recordCountPerBatchDuringIngestionOnly records were sent")
+ private long dataGenSleepTimeDuringIngestionOnly = 1;
+
+ public long getDataGenSleepTimeDuringIngestionOnly() {
+ return dataGenSleepTimeDuringIngestionOnly;
+ }
+
+ @Option(name = "-dstq", aliases = "--data-gen-sleep-time-during-query", usage = "DataGen sleep time in milliseconds after every recordCountPerBatchDuringQuery records were sent")
+ private long dataGenSleepTimeDuringQuery = 1;
+
+ public long getDataGenSleepTimeDuringQuery() {
+ return dataGenSleepTimeDuringQuery;
+ }
+ }
+
+ public static void main(String[] args) throws Exception {
+ // LogManager.getRootLogger().setLevel(org.apache.log4j.Level.OFF);
+ LSMExperimentSetRunnerConfig config = new LSMExperimentSetRunnerConfig(String.valueOf(System
+ .currentTimeMillis()), 3);
+ CmdLineParser clp = new CmdLineParser(config);
+ try {
+ clp.parseArgument(args);
+ } catch (CmdLineException e) {
+ System.err.println(e.getMessage());
+ clp.printUsage(System.err);
+ System.exit(1);
+ }
+
+ Collection<AbstractExperimentBuilder> suite = new ArrayList<>();
+
+ suite.add(new SpatialIndexExperiment1ADhbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment1ADhvbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment1ARtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment1AShbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment1ASifBuilder(config));
+ suite.add(new SpatialIndexExperiment1BDhbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment1BDhvbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment1BRtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment1BShbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment1BSifBuilder(config));
+ suite.add(new SpatialIndexExperiment1CDhbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment1CDhvbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment1CRtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment1CShbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment1CSifBuilder(config));
+ suite.add(new SpatialIndexExperiment1DDhbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment1DDhvbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment1DRtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment1DShbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment1DSifBuilder(config));
+ suite.add(new SpatialIndexExperiment2DhbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment2DhvbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment2RtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment2ShbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment2SifBuilder(config));
+ suite.add(new SpatialIndexExperiment3PIdxLoadBuilder(config));
+ suite.add(new SpatialIndexExperiment3DhbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment3DhvbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment3RtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment3ShbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment3SifBuilder(config));
+ suite.add(new SpatialIndexExperiment4DhbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment4DhvbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment4RtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment4ShbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment4SifBuilder(config));
+ suite.add(new SpatialIndexExperiment5DhbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment5DhvbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment5RtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment5ShbtreeBuilder(config));
+ suite.add(new SpatialIndexExperiment5SifBuilder(config));
+ // suite.add(new Experiment7BBuilder(config));
+ // suite.add(new Experiment7DBuilder(config));
+ // suite.add(new Experiment7ABuilder(config));
+ // suite.add(new Experiment8DBuilder(config));
+ // suite.add(new Experiment8ABuilder(config));
+ // suite.add(new Experiment8BBuilder(config));
+ // suite.add(new Experiment9ABuilder(config));
+ // suite.add(new Experiment9DBuilder(config));
+ // suite.add(new Experiment9BBuilder(config));
+ // suite.add(new Experiment6ABuilder(config));
+ // suite.add(new Experiment6BBuilder(config));
+ // suite.add(new Experiment6CBuilder(config));
+ // suite.add(new Experiment2D1Builder(config));
+ // suite.add(new Experiment2D2Builder(config));
+ // suite.add(new Experiment2D4Builder(config));
+ // suite.add(new Experiment2D8Builder(config));
+ // suite.add(new Experiment2C1Builder(config));
+ // suite.add(new Experiment2C2Builder(config));
+ // suite.add(new Experiment2C4Builder(config));
+ // suite.add(new Experiment2C8Builder(config));
+ // suite.add(new Experiment2A1Builder(config));
+ // suite.add(new Experiment2A2Builder(config));
+ // suite.add(new Experiment2A4Builder(config));
+ // suite.add(new Experiment2A8Builder(config));
+ // suite.add(new Experiment2B1Builder(config));
+ // suite.add(new Experiment2B2Builder(config));
+ // suite.add(new Experiment2B4Builder(config));
+ // suite.add(new Experiment2B8Builder(config));
+ // suite.add(new Experiment1ABuilder(config));
+ // suite.add(new Experiment1BBuilder(config));
+ // suite.add(new Experiment1CBuilder(config));
+ // suite.add(new Experiment1DBuilder(config));
+ // suite.add(new Experiment4ABuilder(config));
+ // suite.add(new Experiment4BBuilder(config));
+ // suite.add(new Experiment4CBuilder(config));
+ // suite.add(new Experiment4DBuilder(config));
+ // suite.add(new Experiment3ABuilder(config));
+ // suite.add(new Experiment3BBuilder(config));
+ // suite.add(new Experiment3CBuilder(config));
+ // suite.add(new Experiment3DBuilder(config));
+ // suite.add(new Experiment5ABuilder(config));
+ // suite.add(new Experiment5BBuilder(config));
+ // suite.add(new Experiment5CBuilder(config));
+ // suite.add(new Experiment5DBuilder(config));
+
+ Pattern p = config.getRegex() == null ? null : Pattern.compile(config.getRegex());
+
+ SequentialActionList exps = new SequentialActionList();
+ for (AbstractExperimentBuilder eb : suite) {
+ if (p == null || p.matcher(eb.getName()).matches()) {
+ exps.add(eb.build());
+ if (LOGGER.isLoggable(Level.INFO)) {
+ LOGGER.info("Added " + eb.getName() + " to run list...");
+ }
+ }
+ }
+ exps.perform();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/OrchestratorDGProtocol.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/OrchestratorDGProtocol.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/OrchestratorDGProtocol.java
new file mode 100644
index 0000000..a29a74c
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/OrchestratorDGProtocol.java
@@ -0,0 +1,26 @@
+/*
+ * 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.experiment.client;
+
+public enum OrchestratorDGProtocol {
+ STOPPED,
+ RESUME,
+ REACHED
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/OrchestratorServer.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/OrchestratorServer.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/OrchestratorServer.java
new file mode 100644
index 0000000..a69b0ce
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/OrchestratorServer.java
@@ -0,0 +1,158 @@
+/*
+ * 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.experiment.client;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.asterix.experiment.action.base.IAction;
+
+public class OrchestratorServer {
+
+ private static final Logger LOGGER = Logger.getLogger(OrchestratorServer.class.getName());
+
+ private final int port;
+
+ private final int nDataGens;
+
+ private final int nIntervals;
+
+ private final AtomicBoolean running;
+
+ private final IAction[] protocolActions;
+
+ private final boolean flagStopResume;
+
+ public OrchestratorServer(int port, int nDataGens, int nIntervals, IAction[] protocolActions) {
+ this.port = port;
+ this.nDataGens = nDataGens;
+ this.nIntervals = nIntervals;
+ running = new AtomicBoolean();
+ this.protocolActions = protocolActions;
+ this.flagStopResume = true;
+ }
+
+ public synchronized void start() throws IOException, InterruptedException {
+ final AtomicBoolean bound = new AtomicBoolean();
+ running.set(true);
+ Thread t = new Thread(new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ ServerSocket ss = new ServerSocket(port);
+ synchronized (bound) {
+ bound.set(true);
+ bound.notifyAll();
+ }
+ Socket[] conn = new Socket[nDataGens];
+ try {
+ for (int i = 0; i < nDataGens; i++) {
+ conn[i] = ss.accept();
+ }
+ for (int n = 0; n < nIntervals; ++n) {
+ //TODO refactor operations according to the protocol message
+ if (flagStopResume) {
+ for (int i = 0; i < nDataGens; i++) {
+ receiveStopped(conn[i]);
+ }
+ protocolActions[n].perform();
+ if (n != nIntervals - 1) {
+ for (int i = 0; i < nDataGens; i++) {
+ sendResume(conn[i]);
+ }
+ }
+ } else {
+ for (int i = 0; i < nDataGens; i++) {
+ receiveReached(conn[i]);
+ }
+ protocolActions[n].perform();
+ }
+ }
+ } finally {
+ for (int i = 0; i < conn.length; ++i) {
+ if (conn[i] != null) {
+ conn[i].close();
+ }
+ }
+ ss.close();
+ }
+ running.set(false);
+ synchronized (OrchestratorServer.this) {
+ OrchestratorServer.this.notifyAll();
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ });
+ t.start();
+ synchronized (bound) {
+ while (!bound.get()) {
+ bound.wait();
+ }
+ }
+ }
+
+ private void sendResume(Socket conn) throws IOException {
+ new DataOutputStream(conn.getOutputStream()).writeInt(OrchestratorDGProtocol.RESUME.ordinal());
+ conn.getOutputStream().flush();
+ if (LOGGER.isLoggable(Level.INFO)) {
+ LOGGER.info("Sent " + OrchestratorDGProtocol.RESUME + " to " + conn.getRemoteSocketAddress());
+ }
+ }
+
+ private void receiveStopped(Socket conn) throws IOException {
+ int msg = new DataInputStream(conn.getInputStream()).readInt();
+ OrchestratorDGProtocol msgType = OrchestratorDGProtocol.values()[msg];
+ if (LOGGER.isLoggable(Level.INFO)) {
+ LOGGER.info("Received " + msgType + " from " + conn.getRemoteSocketAddress());
+ }
+ if (msgType != OrchestratorDGProtocol.STOPPED) {
+ throw new IllegalStateException("Encounted unknown message type " + msgType);
+ }
+ }
+
+ private void receiveReached(Socket conn) throws IOException {
+ int msg = new DataInputStream(conn.getInputStream()).readInt();
+ OrchestratorDGProtocol msgType = OrchestratorDGProtocol.values()[msg];
+ if (LOGGER.isLoggable(Level.INFO)) {
+ LOGGER.info("Received " + msgType + " from " + conn.getRemoteSocketAddress());
+ }
+ if (msgType != OrchestratorDGProtocol.REACHED) {
+ throw new IllegalStateException("Encounted unknown message type " + msgType);
+ }
+
+ }
+
+ public synchronized void awaitFinished() throws InterruptedException {
+ while (running.get()) {
+ wait();
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/OrchestratorServer7.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/OrchestratorServer7.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/OrchestratorServer7.java
new file mode 100644
index 0000000..c547393
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/OrchestratorServer7.java
@@ -0,0 +1,238 @@
+/*
+ * 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.experiment.client;
+
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.asterix.experiment.action.base.IAction;
+import org.apache.asterix.experiment.builder.AbstractExperiment7Builder;
+
+public class OrchestratorServer7 {
+
+ private static final Logger LOGGER = Logger.getLogger(OrchestratorServer7.class.getName());
+
+ private final int port;
+
+ private final int nDataGens;
+
+ private final int nIntervals;
+
+ private final AtomicBoolean running;
+
+ private final IProtocolActionBuilder protoActionBuilder;
+
+ private final IAction lsAction;
+
+ private static final int QUERY_TOTAL_COUNT = 2000;
+
+ public OrchestratorServer7(int port, int nDataGens, int nIntervals, IProtocolActionBuilder protoActionBuilder, IAction lsAction) {
+ this.port = port;
+ this.nDataGens = nDataGens;
+ this.nIntervals = nIntervals;
+ running = new AtomicBoolean();
+ this.protoActionBuilder = protoActionBuilder;
+ this.lsAction = lsAction;
+ }
+
+ public synchronized void start() throws IOException, InterruptedException {
+ final AtomicBoolean bound = new AtomicBoolean();
+ running.set(true);
+ Thread t = new Thread(new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ ServerSocket ss = new ServerSocket(port);
+ synchronized (bound) {
+ bound.set(true);
+ bound.notifyAll();
+ }
+ Socket[] conn = new Socket[nDataGens];
+ try {
+ for (int i = 0; i < nDataGens; i++) {
+ conn[i] = ss.accept();
+ }
+ AtomicInteger round = new AtomicInteger();
+ AtomicBoolean done = new AtomicBoolean(false);
+ Thread pct = new Thread(new ProtocolConsumer(conn, nIntervals, round, done));
+ pct.start();
+ int[] queryType = new int[] { 10, 100, 1000, 10000 };
+ int type = 0;
+ //step1. send query when it reaches the query begin round
+ if (LOGGER.isLoggable(Level.INFO)) {
+ LOGGER.info("Step1 starts");
+ }
+ boolean sendQuery = false;
+ while (!done.get()) {
+ if (!sendQuery) {
+ synchronized (round) {
+ while (true) {
+ if (round.get() >= AbstractExperiment7Builder.QUERY_BEGIN_ROUND) {
+ sendQuery = true;
+ break;
+ }
+ round.wait();
+ }
+ }
+ }
+ if (sendQuery) {
+ protoActionBuilder.buildQueryAction(queryType[type % 4], false).perform();
+ type = (++type) % 4;
+ }
+
+ }
+ pct.join();
+ if (LOGGER.isLoggable(Level.INFO)) {
+ LOGGER.info("Step1 ends");
+ }
+
+ if (LOGGER.isLoggable(Level.INFO)) {
+ LOGGER.info("Step2 starts");
+ }
+ //step2. send one more round of queries after ingestion is over
+ protoActionBuilder.buildIOWaitAction().perform();
+ lsAction.perform();
+ for (int i = 0; i < QUERY_TOTAL_COUNT; i++) {
+ protoActionBuilder.buildQueryAction(queryType[i % 4], true).perform();
+ }
+ if (LOGGER.isLoggable(Level.INFO)) {
+ LOGGER.info("Step2 ends");
+ }
+
+ if (LOGGER.isLoggable(Level.INFO)) {
+ LOGGER.info("Step3 starts");
+ }
+ //step3. compact dataset
+ protoActionBuilder.buildCompactAction().perform();
+ protoActionBuilder.buildIOWaitAction().perform();
+ if (LOGGER.isLoggable(Level.INFO)) {
+ LOGGER.info("Step3 ends");
+ }
+
+ if (LOGGER.isLoggable(Level.INFO)) {
+ LOGGER.info("Step4 starts");
+ }
+ //step4. send last round of queries after the compaction is over
+ for (int i = 0; i < QUERY_TOTAL_COUNT; i++) {
+ protoActionBuilder.buildQueryAction(queryType[i % 4], true).perform();
+ }
+ if (LOGGER.isLoggable(Level.INFO)) {
+ LOGGER.info("Step4 ends");
+ }
+
+ } finally {
+ for (int i = 0; i < conn.length; ++i) {
+ if (conn[i] != null) {
+ conn[i].close();
+ }
+ }
+ ss.close();
+ }
+ running.set(false);
+ synchronized (OrchestratorServer7.this) {
+ OrchestratorServer7.this.notifyAll();
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ });
+ t.start();
+ synchronized (bound) {
+ while (!bound.get()) {
+ bound.wait();
+ }
+ }
+ }
+
+ private static class ProtocolConsumer implements Runnable {
+
+ private final Socket[] conn;
+
+ private final int nIntervals;
+
+ private final AtomicInteger interval;
+
+ private final AtomicBoolean done;
+
+ public ProtocolConsumer(Socket[] conn, int nIntervals, AtomicInteger interval, AtomicBoolean done) {
+ this.conn = conn;
+ this.nIntervals = nIntervals;
+ this.interval = interval;
+ this.done = done;
+ }
+
+ @Override
+ public void run() {
+ interval.set(0);
+ try {
+ for (int n = 0; n < nIntervals; ++n) {
+ for (int i = 0; i < conn.length; i++) {
+ receiveReached(conn[i]);
+ }
+ synchronized (interval) {
+ interval.getAndIncrement();
+ interval.notifyAll();
+ }
+ }
+ done.set(true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ }
+
+ private static void receiveReached(Socket conn) throws IOException {
+ int msg = new DataInputStream(conn.getInputStream()).readInt();
+ OrchestratorDGProtocol msgType = OrchestratorDGProtocol.values()[msg];
+ if (LOGGER.isLoggable(Level.INFO)) {
+ LOGGER.info("Received " + msgType + " from " + conn.getRemoteSocketAddress());
+ }
+ if (msgType != OrchestratorDGProtocol.REACHED) {
+ throw new IllegalStateException("Encounted unknown message type " + msgType);
+ }
+
+ }
+
+ public synchronized void awaitFinished() throws InterruptedException {
+ while (running.get()) {
+ wait();
+ }
+ }
+
+ public interface IProtocolActionBuilder {
+ public IAction buildQueryAction(long cardinality, boolean finalRound) throws Exception;
+
+ public IAction buildIOWaitAction() throws Exception;
+
+ public IAction buildCompactAction() throws Exception;
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/a70fba5c/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/OrchestratorServer9.java
----------------------------------------------------------------------
diff --git a/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/OrchestratorServer9.java b/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/OrchestratorServer9.java
new file mode 100644
index 0000000..be50e7c
--- /dev/null
+++ b/asterix-experiments/src/main/java/org/apache/asterix/experiment/client/OrchestratorServer9.java
@@ -0,0 +1,164 @@
+/*
+ * 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.experiment.client;
+
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.asterix.experiment.action.base.IAction;
+
+public class OrchestratorServer9 {
+
+ private static final Logger LOGGER = Logger.getLogger(OrchestratorServer9.class.getName());
+
+ private final int port;
+
+ private final int nDataGens;
+
+ private final int nIntervals;
+
+ private final AtomicBoolean running;
+
+ private final IProtocolActionBuilder protoActionBuilder;
+
+ public OrchestratorServer9(int port, int nDataGens, int nIntervals, IProtocolActionBuilder protoActionBuilder) {
+ this.port = port;
+ this.nDataGens = nDataGens;
+ this.nIntervals = nIntervals;
+ running = new AtomicBoolean();
+ this.protoActionBuilder = protoActionBuilder;
+ }
+
+ public synchronized void start() throws IOException, InterruptedException {
+ final AtomicBoolean bound = new AtomicBoolean();
+ running.set(true);
+ Thread t = new Thread(new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ ServerSocket ss = new ServerSocket(port);
+ synchronized (bound) {
+ bound.set(true);
+ bound.notifyAll();
+ }
+ Socket[] conn = new Socket[nDataGens];
+ try {
+ for (int i = 0; i < nDataGens; i++) {
+ conn[i] = ss.accept();
+ }
+ AtomicInteger round = new AtomicInteger();
+ AtomicBoolean done = new AtomicBoolean(false);
+ Thread pct = new Thread(new ProtocolConsumer(conn, nIntervals, round, done));
+ pct.start();
+ while (!done.get()) {
+ protoActionBuilder.buildAction(round.get()).perform();
+ }
+ pct.join();
+ } finally {
+ for (int i = 0; i < conn.length; ++i) {
+ if (conn[i] != null) {
+ conn[i].close();
+ }
+ }
+ ss.close();
+ }
+ running.set(false);
+ synchronized (OrchestratorServer9.this) {
+ OrchestratorServer9.this.notifyAll();
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ });
+ t.start();
+ synchronized (bound) {
+ while (!bound.get()) {
+ bound.wait();
+ }
+ }
+ }
+
+ private static class ProtocolConsumer implements Runnable {
+
+ private final Socket[] conn;
+
+ private final int nIntervals;
+
+ private final AtomicInteger interval;
+
+ private final AtomicBoolean done;
+
+ public ProtocolConsumer(Socket[] conn, int nIntervals, AtomicInteger interval, AtomicBoolean done) {
+ this.conn = conn;
+ this.nIntervals = nIntervals;
+ this.interval = interval;
+ this.done = done;
+ }
+
+ @Override
+ public void run() {
+ interval.set(0);
+ try {
+ for (int n = 0; n < nIntervals; ++n) {
+ for (int i = 0; i < conn.length; i++) {
+ receiveReached(conn[i]);
+ }
+ interval.getAndIncrement();
+ }
+ done.set(true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ }
+
+ private static void receiveReached(Socket conn) throws IOException {
+ int msg = new DataInputStream(conn.getInputStream()).readInt();
+ OrchestratorDGProtocol msgType = OrchestratorDGProtocol.values()[msg];
+ if (LOGGER.isLoggable(Level.INFO)) {
+ LOGGER.info("Received " + msgType + " from " + conn.getRemoteSocketAddress());
+ }
+ if (msgType != OrchestratorDGProtocol.REACHED) {
+ throw new IllegalStateException("Encounted unknown message type " + msgType);
+ }
+
+ }
+
+ public synchronized void awaitFinished() throws InterruptedException {
+ while (running.get()) {
+ wait();
+ }
+ }
+
+ public interface IProtocolActionBuilder {
+ public IAction buildAction(int round) throws Exception;
+ }
+
+}