[NO ISSUE] Delete asterix-experiments This package likewise with yarn, uses managix, though this one is far more ingrained. It was used for performance experiments for a time but is largely unused in master now.
Change-Id: Ic58e174d2694719881519739faa9096a1f07e09d Reviewed-on: https://asterix-gerrit.ics.uci.edu/2187 Reviewed-by: Michael Blow <[email protected]> Integration-Tests: Ian Maxon <[email protected]> Tested-by: Ian Maxon <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/0e21afa7 Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/0e21afa7 Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/0e21afa7 Branch: refs/heads/master Commit: 0e21afa73cbd5064c0e79c20dad1a98a580ffdc2 Parents: 6b765f3 Author: Michael Blow <[email protected]> Authored: Wed Nov 29 22:20:40 2017 -0500 Committer: Ian Maxon <[email protected]> Committed: Wed Nov 29 20:55:16 2017 -0800 ---------------------------------------------------------------------- asterixdb/asterix-experiments/pom.xml | 213 ----- .../main/appended-resources/META-INF/LICENSE | 53 -- .../src/main/assembly/binary-assembly.xml | 37 - .../experiment/action/base/AbstractAction.java | 45 - .../action/base/DefaultExceptionListener.java | 38 - .../asterix/experiment/action/base/IAction.java | 24 - .../action/base/IExceptionListener.java | 24 - .../action/base/ParallelActionSet.java | 75 -- .../action/base/SequentialActionList.java | 42 - .../derived/AbstractExecutableAction.java | 65 -- .../derived/AbstractLocalExecutableAction.java | 54 -- .../derived/AbstractRemoteExecutableAction.java | 89 -- .../action/derived/CloseOutputStreamAction.java | 40 - .../action/derived/ManagixActions.java | 143 --- .../action/derived/RemoteAsterixDriverKill.java | 34 - .../action/derived/RemoteCopyFileAction.java | 70 -- .../action/derived/RunAQLFileAction.java | 98 -- .../action/derived/RunAQLStringAction.java | 86 -- .../action/derived/RunRESTIOWaitAction.java | 54 -- .../action/derived/RunSQLPPFileAction.java | 105 --- .../experiment/action/derived/SleepAction.java | 37 - .../derived/StartDataGeneratorAction.java | 53 -- .../experiment/action/derived/TimedAction.java | 61 -- .../builder/AbstractExperiment1Builder.java | 40 - .../builder/AbstractExperiment2ABuilder.java | 39 - .../builder/AbstractExperiment2BBuilder.java | 39 - .../builder/AbstractExperiment2CBuilder.java | 45 - .../builder/AbstractExperiment2DBuilder.java | 45 - .../builder/AbstractExperiment3Builder.java | 39 - .../builder/AbstractExperiment4Builder.java | 29 - .../builder/AbstractExperiment6Builder.java | 29 - .../builder/AbstractExperiment7Builder.java | 183 ---- .../builder/AbstractExperiment8Builder.java | 181 ---- .../builder/AbstractExperiment9Builder.java | 184 ---- .../builder/AbstractExperimentBuilder.java | 40 - .../AbstractLSMBaseExperimentBuilder.java | 357 ------- .../builder/AbstractLocalExperimentBuilder.java | 37 - .../builder/AbstractPerfLoadBuilder.java | 251 ----- .../AbstractSpatialIndexExperiment2Builder.java | 173 ---- ...tSpatialIndexExperiment3PIdxLoadBuilder.java | 293 ------ ...dexExperiment3SIdxCreateAndQueryBuilder.java | 532 ----------- .../asterix/experiment/builder/Experiment.java | 58 -- .../experiment/builder/Experiment1ABuilder.java | 30 - .../experiment/builder/Experiment1BBuilder.java | 30 - .../experiment/builder/Experiment1CBuilder.java | 30 - .../experiment/builder/Experiment1DBuilder.java | 29 - .../experiment/builder/Experiment1EBuilder.java | 30 - .../builder/Experiment2A1Builder.java | 30 - .../builder/Experiment2A2Builder.java | 30 - .../builder/Experiment2A4Builder.java | 30 - .../builder/Experiment2A8Builder.java | 30 - .../builder/Experiment2B1Builder.java | 29 - .../builder/Experiment2B2Builder.java | 30 - .../builder/Experiment2B4Builder.java | 30 - .../builder/Experiment2B8Builder.java | 30 - .../builder/Experiment2C1Builder.java | 30 - .../builder/Experiment2C2Builder.java | 30 - .../builder/Experiment2C4Builder.java | 30 - .../builder/Experiment2C8Builder.java | 30 - .../builder/Experiment2D1Builder.java | 30 - .../builder/Experiment2D2Builder.java | 30 - .../builder/Experiment2D4Builder.java | 30 - .../builder/Experiment2D8Builder.java | 30 - .../experiment/builder/Experiment3ABuilder.java | 30 - .../experiment/builder/Experiment3BBuilder.java | 30 - .../experiment/builder/Experiment3CBuilder.java | 30 - .../experiment/builder/Experiment3DBuilder.java | 30 - .../experiment/builder/Experiment4ABuilder.java | 39 - .../experiment/builder/Experiment4BBuilder.java | 39 - .../experiment/builder/Experiment4CBuilder.java | 39 - .../experiment/builder/Experiment4DBuilder.java | 39 - .../experiment/builder/Experiment5ABuilder.java | 39 - .../experiment/builder/Experiment5BBuilder.java | 39 - .../experiment/builder/Experiment5CBuilder.java | 39 - .../experiment/builder/Experiment5DBuilder.java | 39 - .../experiment/builder/Experiment6ABuilder.java | 39 - .../experiment/builder/Experiment6BBuilder.java | 39 - .../experiment/builder/Experiment6CBuilder.java | 39 - .../experiment/builder/Experiment7ABuilder.java | 38 - .../experiment/builder/Experiment7BBuilder.java | 38 - .../experiment/builder/Experiment7DBuilder.java | 38 - .../experiment/builder/Experiment8ABuilder.java | 40 - .../experiment/builder/Experiment8BBuilder.java | 40 - .../experiment/builder/Experiment8CBuilder.java | 40 - .../experiment/builder/Experiment8DBuilder.java | 40 - .../experiment/builder/Experiment9ABuilder.java | 38 - .../experiment/builder/Experiment9BBuilder.java | 38 - .../experiment/builder/Experiment9DBuilder.java | 38 - .../experiment/builder/PerfTestAggBuilder.java | 40 - .../builder/PresetClusterPerfBuilder.java | 134 --- .../SingleNodeIngestionExperimentBuilder.java | 71 -- .../SpatialIndexExperiment1ADhbtreeBuilder.java | 39 - ...SpatialIndexExperiment1ADhvbtreeBuilder.java | 39 - .../SpatialIndexExperiment1ARtreeBuilder.java | 39 - .../SpatialIndexExperiment1AShbtreeBuilder.java | 39 - .../SpatialIndexExperiment1ASifBuilder.java | 39 - .../SpatialIndexExperiment1BDhbtreeBuilder.java | 38 - ...SpatialIndexExperiment1BDhvbtreeBuilder.java | 38 - .../SpatialIndexExperiment1BRtreeBuilder.java | 38 - .../SpatialIndexExperiment1BShbtreeBuilder.java | 38 - .../SpatialIndexExperiment1BSifBuilder.java | 38 - .../SpatialIndexExperiment1CDhbtreeBuilder.java | 39 - ...SpatialIndexExperiment1CDhvbtreeBuilder.java | 39 - .../SpatialIndexExperiment1CRtreeBuilder.java | 39 - .../SpatialIndexExperiment1CShbtreeBuilder.java | 39 - .../SpatialIndexExperiment1CSifBuilder.java | 39 - .../SpatialIndexExperiment1DDhbtreeBuilder.java | 38 - ...SpatialIndexExperiment1DDhvbtreeBuilder.java | 38 - .../SpatialIndexExperiment1DRtreeBuilder.java | 38 - .../SpatialIndexExperiment1DShbtreeBuilder.java | 38 - .../SpatialIndexExperiment1DSifBuilder.java | 38 - .../SpatialIndexExperiment2DhbtreeBuilder.java | 38 - .../SpatialIndexExperiment2DhvbtreeBuilder.java | 38 - .../SpatialIndexExperiment2RtreeBuilder.java | 38 - .../SpatialIndexExperiment2ShbtreeBuilder.java | 38 - .../SpatialIndexExperiment2SifBuilder.java | 38 - .../SpatialIndexExperiment3DhbtreeBuilder.java | 30 - .../SpatialIndexExperiment3DhvbtreeBuilder.java | 30 - .../SpatialIndexExperiment3PIdxLoadBuilder.java | 39 - .../SpatialIndexExperiment3RtreeBuilder.java | 30 - .../SpatialIndexExperiment3ShbtreeBuilder.java | 30 - .../SpatialIndexExperiment3SifBuilder.java | 30 - .../SpatialIndexExperiment4DhbtreeBuilder.java | 31 - .../SpatialIndexExperiment4DhvbtreeBuilder.java | 31 - .../SpatialIndexExperiment4RtreeBuilder.java | 31 - .../SpatialIndexExperiment4ShbtreeBuilder.java | 31 - .../SpatialIndexExperiment4SifBuilder.java | 31 - .../SpatialIndexExperiment5DhbtreeBuilder.java | 39 - .../SpatialIndexExperiment5DhvbtreeBuilder.java | 39 - .../SpatialIndexExperiment5RtreeBuilder.java | 39 - .../SpatialIndexExperiment5ShbtreeBuilder.java | 39 - .../SpatialIndexExperiment5SifBuilder.java | 39 - .../client/LSMExperimentConstants.java | 38 - .../client/LSMExperimentSetRunner.java | 306 ------ .../experiment/client/LSMPerfConstants.java | 43 - .../client/OrchestratorDGProtocol.java | 26 - .../experiment/client/OrchestratorServer.java | 158 ---- .../experiment/client/OrchestratorServer7.java | 238 ----- .../experiment/client/OrchestratorServer9.java | 164 ---- .../experiment/client/RecordCountingServer.java | 166 ---- .../client/SocketDataGeneratorExecutable.java | 57 -- .../experiment/client/SocketTweetGenerator.java | 389 -------- .../client/SocketTweetGeneratorConfig.java | 173 ---- .../client/SocketTweetGeneratorDriver.java | 47 - ...atialIndexExperiment2OrchestratorServer.java | 179 ---- .../client/SpatialQueryGenerator.java | 315 ------- .../client/SpatialQueryGeneratorConfig.java | 135 --- .../client/SpatialQueryGeneratorDriver.java | 40 - .../client/SyntheticDataGeneratorConfig.java | 60 -- ...cDataGeneratorForSpatialIndexEvaluation.java | 105 --- .../logging/ExperimentLogFormatter.java | 128 --- .../AbstractDynamicDataEvalReportBuilder.java | 286 ------ .../AbstractStaticDataEvalReportBuilder.java | 31 - .../report/IDynamicDataEvalReportBuilder.java | 34 - .../report/IStaticDataEvalReportBuilder.java | 25 - .../experiment/report/NCLogReportBuilder.java | 212 ----- .../report/OperatorProfilerReportBuilder.java | 322 ------- .../report/ProfilerReportBuilder.java | 192 ---- .../experiment/report/ReportBuilderHelper.java | 104 --- .../experiment/report/ReportBuilderRunner.java | 126 --- .../experiment/report/SIE1ReportBuilder.java | 69 -- .../report/SIE1ReportBuilderRunner.java | 329 ------- .../experiment/report/SIE2ReportBuilder.java | 264 ------ .../report/SIE2ReportBuilderRunner.java | 459 --------- .../report/SIE3ProfileReportBuilder.java | 69 -- .../experiment/report/SIE3ReportBuilder.java | 294 ------ .../report/SIE3ReportBuilderRunner.java | 716 -------------- .../report/SIE4ReportBuilderRunner.java | 715 -------------- .../report/SIE5ReportBuilderRunner.java | 459 --------- .../src/main/resources/gantt/foo.eps | 928 ------------------- .../src/main/resources/gantt/foo.gpl | 35 - .../src/main/resources/gantt/gantt.py | 432 --------- .../src/main/resources/gantt/vargantt1.gpl | 35 - .../src/main/resources/gantt/vargantt1.plt | 4 - .../src/main/resources/gantt/vargantt1.txt | 18 - .../aql/1.aql | 21 - .../aql/2_a.aql | 22 - .../aql/2_b.aql | 22 - .../aql/2_c.aql | 22 - .../aql/2_d.aql | 22 - .../aql/3.aql | 25 - .../aql/4_1.aql | 22 - .../aql/4_2.aql | 23 - .../aql/4_4.aql | 25 - .../aql/4_8.aql | 29 - .../aql/5_1.aql | 21 - .../aql/5_1_count.aql | 22 - .../aql/5_2.aql | 22 - .../aql/5_2_count.aql | 25 - .../aql/5_3.aql | 23 - .../aql/5_3_count.aql | 28 - .../aql/5_4.aql | 24 - .../aql/5_4_count.aql | 31 - .../aql/6_a.aql | 21 - .../aql/6_b.aql | 22 - .../aql/6_c.aql | 21 - .../aql/7_a.aql | 21 - .../aql/7_b.aql | 22 - .../aql/7_c.aql | 21 - .../aql/7_compact.aql | 21 - .../aql/7_d.aql | 21 - .../aql/7_q1.aql | 26 - .../aql/7_q2.aql | 26 - .../aql/8_a.aql | 22 - .../aql/8_b.aql | 23 - .../aql/8_c.aql | 22 - .../aql/8_compact.aql | 21 - .../aql/8_d.aql | 22 - .../aql/8_q1.aql | 26 - .../aql/8_q2.aql | 26 - .../aql/agg.sqlpp | 28 - .../aql/agg_bench/agg-3-months.sqlpp | 27 - .../aql/agg_bench/agg-6-months.sqlpp | 27 - .../aql/agg_bench/agg-day.sqlpp | 27 - .../aql/agg_bench/agg-hour.sqlpp | 27 - .../aql/agg_bench/agg-minute.sqlpp | 27 - .../aql/agg_bench/agg-month.sqlpp | 27 - .../aql/agg_bench/agg-week.sqlpp | 27 - .../aql/agg_bench/countjoin-3-months.sqlpp | 36 - .../aql/agg_bench/countjoin-6-months.sqlpp | 36 - .../aql/agg_bench/countjoin-day.sqlpp | 36 - .../aql/agg_bench/countjoin-hour.sqlpp | 36 - .../aql/agg_bench/countjoin-minute.sqlpp | 36 - .../aql/agg_bench/countjoin-month.sqlpp | 36 - .../aql/agg_bench/countjoin-week.sqlpp | 36 - .../agg_bench/countjoin_index-3-months.sqlpp | 36 - .../agg_bench/countjoin_index-6-months.sqlpp | 36 - .../aql/agg_bench/countjoin_index-day.sqlpp | 36 - .../aql/agg_bench/countjoin_index-hour.sqlpp | 36 - .../aql/agg_bench/countjoin_index-minute.sqlpp | 36 - .../aql/agg_bench/countjoin_index-month.sqlpp | 36 - .../aql/agg_bench/countjoin_index-week.sqlpp | 36 - .../aql/agg_bench/join-3-months.sqlpp | 32 - .../aql/agg_bench/join-6-months.sqlpp | 32 - .../aql/agg_bench/join-day.sqlpp | 32 - .../aql/agg_bench/join-hour.sqlpp | 32 - .../aql/agg_bench/join-minute.sqlpp | 32 - .../aql/agg_bench/join-month.sqlpp | 32 - .../aql/agg_bench/join-week.sqlpp | 32 - .../aql/agg_bench/join_indexnl-3-months.sqlpp | 32 - .../aql/agg_bench/join_indexnl-6-months.sqlpp | 32 - .../aql/agg_bench/join_indexnl-day.sqlpp | 32 - .../aql/agg_bench/join_indexnl-hour.sqlpp | 32 - .../aql/agg_bench/join_indexnl-minute.sqlpp | 32 - .../aql/agg_bench/join_indexnl-month.sqlpp | 32 - .../aql/agg_bench/join_indexnl-week.sqlpp | 32 - .../aql/agg_bench/joingby-3-months.sqlpp | 31 - .../aql/agg_bench/joingby-6-months.sqlpp | 31 - .../aql/agg_bench/joingby-day.sqlpp | 31 - .../aql/agg_bench/joingby-hour.sqlpp | 31 - .../aql/agg_bench/joingby-minute.sqlpp | 31 - .../aql/agg_bench/joingby-month.sqlpp | 31 - .../aql/agg_bench/joingby-week.sqlpp | 31 - .../aql/agg_bench/joingby_index-3-months.sqlpp | 31 - .../aql/agg_bench/joingby_index-6-months.sqlpp | 31 - .../aql/agg_bench/joingby_index-day.sqlpp | 31 - .../aql/agg_bench/joingby_index-hour.sqlpp | 31 - .../aql/agg_bench/joingby_index-minute.sqlpp | 31 - .../aql/agg_bench/joingby_index-month.sqlpp | 31 - .../aql/agg_bench/joingby_index-week.sqlpp | 31 - .../aql/agg_bench/select-all.sqlpp | 21 - .../aql/avg_gram_tokens.aql | 24 - .../aql/avg_keyword_tokens.aql | 24 - .../aql/base/5_1_ingest.aql | 33 - .../aql/base/5_2_ingest.aql | 44 - .../aql/base/5_3_ingest.aql | 55 -- .../aql/base/5_4_ingest.aql | 66 -- .../aql/base/asterix_base_4_ingest.aql | 20 - .../aql/base/base_1_ingest.aql | 42 - .../aql/base/base_1_ingest_query.aql | 42 - .../aql/base/base_2_ingest.aql | 42 - .../aql/base/base_4_ingest.aql | 42 - .../aql/base/base_8_ingest.aql | 42 - .../aql/base/base_8_ingest_query.aql | 32 - .../aql/base/base_types.aql | 49 - .../aql/base/nuclear_base_4_ingest.aql | 32 - .../aql/base/perf_types.aql | 63 -- .../aql/bench_3.aql | 26 - .../aql/bench_3_load.aql | 26 - .../aql/bench_3_load_2.aql | 25 - .../aql/bench_count.aql | 22 - .../aql/count.aql | 22 - .../aql/spatial_1_dhbtree.aql | 21 - .../aql/spatial_1_dhvbtree.aql | 21 - .../aql/spatial_1_rtree.aql | 21 - .../aql/spatial_1_shbtree.aql | 21 - .../aql/spatial_1_sif.aql | 21 - .../aql/spatial_3.aql | 21 - .../aql/spatial_3_create_dhbtree.aql | 20 - .../aql/spatial_3_create_dhvbtree.aql | 20 - .../aql/spatial_3_create_rtree.aql | 20 - .../aql/spatial_3_create_shbtree.aql | 20 - .../aql/spatial_3_create_sif.aql | 20 - .../aql/spatial_3_pidx_load.aql | 44 - .../balloon.c | 41 - .../configs/1node.xml | 39 - .../configs/2node.xml | 44 - .../configs/4node.xml | 52 -- .../configs/8node.xml | 68 -- .../configs/asterix-agg.xml | 55 -- .../configs/asterix-configuration.xml | 253 ----- .../configs/managix-conf.xml | 36 - .../configs/nuclear.xml | 52 -- .../dgen/1.dgen | 1 - .../dgen/2.dgen | 2 - .../dgen/4.dgen | 4 - .../dgen/5_1.dgen | 8 - .../dgen/5_2.dgen | 16 - .../dgen/5_3.dgen | 24 - .../dgen/5_4.dgen | 32 - .../dgen/8.dgen | 8 - .../dgen/8.dqgen | 8 - .../dgen/asterix-4.dgen | 4 - .../dgen/nuc.dgen | 3 - .../killdrivers.sh | 21 - .../killscreens.sh | 22 - .../logging.properties | 84 -- .../updateMain.sh | 24 - asterixdb/pom.xml | 12 - 319 files changed, 20761 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e21afa7/asterixdb/asterix-experiments/pom.xml ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-experiments/pom.xml b/asterixdb/asterix-experiments/pom.xml deleted file mode 100644 index 4a091bb..0000000 --- a/asterixdb/asterix-experiments/pom.xml +++ /dev/null @@ -1,213 +0,0 @@ -<!-- - ! Copyright 2009-2013 by The Regents of the University of California - ! Licensed 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 from - ! - ! http://www.apache.org/licenses/LICENSE-2.0 - ! - ! Unless required by applicable law or agreed to in writing, software - ! distributed under the License is distributed on an "AS IS" BASIS, - ! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ! See the License for the specific language governing permissions and - ! limitations under the License. - !--> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <artifactId>apache-asterixdb</artifactId> - <groupId>org.apache.asterix</groupId> - <version>0.9.3-SNAPSHOT</version> - </parent> - <artifactId>asterix-experiments</artifactId> - - <build> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>appassembler-maven-plugin</artifactId> - <executions> - <execution> - <configuration> - <programs> - <program> - <mainClass>org.apache.asterix.experiment.client.LSMExperimentSetRunner</mainClass> - <name>lsmexprunner</name> - </program> - <program> - <mainClass>org.apache.asterix.experiment.client.SocketTweetGeneratorDriver</mainClass> - <name>datagenrunner</name> - </program> - <program> - <mainClass>org.apache.asterix.experiment.client.SpatialQueryGeneratorDriver</mainClass> - <name>querygenrunner</name> - </program> - <program> - <mainClass>org.apache.asterix.experiment.client.RecordCountingServer</mainClass> - <name>rcserver</name> - </program> - </programs> - <repositoryLayout>flat</repositoryLayout> - <repositoryName>lib</repositoryName> - </configuration> - <phase>package</phase> - <goals> - <goal>assemble</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <artifactId>maven-assembly-plugin</artifactId> - <executions> - <execution> - <configuration> - <descriptors> - <descriptor>src/main/assembly/binary-assembly.xml</descriptor> - </descriptors> - </configuration> - <phase>package</phase> - <goals> - <goal>single</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <configuration> - <failOnWarning>false</failOnWarning> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - <configuration> - <licenses combine.children="append"> - <license implementation="org.apache.rat.analysis.license.FullTextMatchingLicense"> - <licenseFamilyCategory>BSD</licenseFamilyCategory> - <licenseFamilyName>Modified BSD License</licenseFamilyName> - <fullText> - Copyright (c) 2013, Los Alamos National Security, LLC - All rights reserved. - - Copyright 2013. Los Alamos National Security, LLC. This software - was produced under U.S. Government contract DE-AC52-06NA25396 for - Los Alamos National Laboratory (LANL), which is operated by Los - Alamos National Security, LLC for the U.S. Department of Energy. - The U.S. Government has rights to use, reproduce, and distribute - this software. NEITHER THE GOVERNMENT NOR LOS ALAMOS NATIONAL - SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES - ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified - to produce derivative works, such modified software should be clearly - marked, so as not to confuse it with the version available from LANL. - - - Additionally, redistribution and use in source and binary forms, - with or without modification, are permitted provided that the - following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - * Neither the name of Los Alamos National Security, LLC, Los Alamos - National Laboratory, LANL, the U.S. Government, nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL SECURITY, LLC OR CONTRIBUTORS - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - </fullText> - </license> - </licenses> - <licenseFamilies combine.children="append"> - <licenseFamily implementation="org.apache.rat.license.ModifiedBSDLicenseFamily"/> - </licenseFamilies> - <excludes combine.children="append"> - <exclude>**/*.dgen</exclude> - <exclude>**/*.dqgen</exclude> - <exclude>src/main/resources/gantt/vargantt1.txt</exclude> - <exclude>src/main/resources/gantt/*.eps</exclude> <!-- generated by gnuplot --> - <exclude>src/main/resources/gantt/*.gpl</exclude> <!-- generated by Gantt --> - <exclude>src/main/resources/gantt/*.plt</exclude> <!-- generated by Gantt --> - </excludes> - </configuration> - </plugin> - </plugins> - </build> - - <dependencies> - <dependency> - <groupId>org.apache.hyracks</groupId> - <artifactId>hyracks-api</artifactId> - </dependency> - <dependency> - <groupId>org.apache.hyracks</groupId> - <artifactId>hyracks-control-cc</artifactId> - </dependency> - <dependency> - <groupId>org.apache.asterix</groupId> - <artifactId>asterix-common</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.apache.asterix</groupId> - <artifactId>asterix-app</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.apache.asterix</groupId> - <artifactId>asterix-tools</artifactId> - <version>${project.version}</version> - <type>test-jar</type> - </dependency> - <dependency> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpclient</artifactId> - </dependency> - <dependency> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpcore</artifactId> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - </dependency> - <dependency> - <groupId>commons-httpclient</groupId> - <artifactId>commons-httpclient</artifactId> - <version>3.0.1</version> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-lang3</artifactId> - </dependency> - <dependency> - <groupId>args4j</groupId> - <artifactId>args4j</artifactId> - </dependency> - <dependency> - <groupId>javax.xml.bind</groupId> - <artifactId>jaxb-api</artifactId> - </dependency> - <dependency> - <groupId>com.hierynomus</groupId> - <artifactId>sshj</artifactId> - <version>0.13.0</version> - </dependency> - </dependencies> - -</project> http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e21afa7/asterixdb/asterix-experiments/src/main/appended-resources/META-INF/LICENSE ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-experiments/src/main/appended-resources/META-INF/LICENSE b/asterixdb/asterix-experiments/src/main/appended-resources/META-INF/LICENSE deleted file mode 100644 index f22880d..0000000 --- a/asterixdb/asterix-experiments/src/main/appended-resources/META-INF/LICENSE +++ /dev/null @@ -1,53 +0,0 @@ -=== - AsterixDB includes source code with separate copyright notices and - license terms. Your use of this source code is subject to the terms - and condition of the following licenses. -=== - A portion of the AsterixDB Experimental Tests - located at: - src/main/resources/gantt/gantt.py - - is available under a Modified BSD License: ---- - Copyright (c) 2013, Los Alamos National Security, LLC - All rights reserved. - - Copyright 2013. Los Alamos National Security, LLC. This software - was produced under U.S. Government contract DE-AC52-06NA25396 for - Los Alamos National Laboratory (LANL), which is operated by Los - Alamos National Security, LLC for the U.S. Department of Energy. - The U.S. Government has rights to use, reproduce, and distribute - this software. NEITHER THE GOVERNMENT NOR LOS ALAMOS NATIONAL - SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES - ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified - to produce derivative works, such modified software should be clearly - marked, so as not to confuse it with the version available from LANL. - - - Additionally, redistribution and use in source and binary forms, - with or without modification, are permitted provided that the - following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - * Neither the name of Los Alamos National Security, LLC, Los Alamos - National Laboratory, LANL, the U.S. Government, nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL SECURITY, LLC OR CONTRIBUTORS - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---- http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e21afa7/asterixdb/asterix-experiments/src/main/assembly/binary-assembly.xml ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-experiments/src/main/assembly/binary-assembly.xml b/asterixdb/asterix-experiments/src/main/assembly/binary-assembly.xml deleted file mode 100644 index 98f5aba..0000000 --- a/asterixdb/asterix-experiments/src/main/assembly/binary-assembly.xml +++ /dev/null @@ -1,37 +0,0 @@ -<!-- - ! Copyright 2009-2013 by The Regents of the University of California - ! Licensed 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 from - ! - ! 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. - !--> -<assembly> - <id>binary-assembly</id> - <formats> - <format>zip</format> - <format>dir</format> - </formats> - <includeBaseDirectory>false</includeBaseDirectory> - <fileSets> - <fileSet> - <directory>target/appassembler/bin</directory> - <outputDirectory>bin</outputDirectory> - <fileMode>0755</fileMode> - </fileSet> - <fileSet> - <directory>target/appassembler/lib</directory> - <outputDirectory>lib</outputDirectory> - </fileSet> - <fileSet> - <directory>src/main/resources/ingestion-experiment-binary-and-configs</directory> - <outputDirectory>.</outputDirectory> - </fileSet> - </fileSets> -</assembly> http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e21afa7/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/AbstractAction.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/AbstractAction.java b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/AbstractAction.java deleted file mode 100644 index 0e58dd4..0000000 --- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/AbstractAction.java +++ /dev/null @@ -1,45 +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.experiment.action.base; - -public abstract class AbstractAction implements IAction { - - private final IExceptionListener el; - - protected AbstractAction() { - el = new DefaultExceptionListener(); - } - - protected AbstractAction(IExceptionListener el) { - this.el = el; - } - - @Override - public void perform() { - try { - doPerform(); - } catch (Throwable t) { - el.caughtException(t); - } - } - - protected abstract void doPerform() throws Exception; - -} http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e21afa7/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/DefaultExceptionListener.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/DefaultExceptionListener.java b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/DefaultExceptionListener.java deleted file mode 100644 index 5f89871..0000000 --- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/DefaultExceptionListener.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.asterix.experiment.action.base; - -import java.util.logging.Level; -import java.util.logging.Logger; - -public class DefaultExceptionListener implements IExceptionListener { - - private static final Logger LOGGER = Logger.getLogger(DefaultExceptionListener.class.getName()); - - @Override - public void caughtException(Throwable t) { - if (LOGGER.isLoggable(Level.SEVERE)) { - LOGGER.severe("Caught exception: " + t); - LOGGER.severe("Stopping..."); - t.printStackTrace(); - } - System.exit(1); - } -} http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e21afa7/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/IAction.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/IAction.java b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/IAction.java deleted file mode 100644 index c174a6f..0000000 --- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/IAction.java +++ /dev/null @@ -1,24 +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.experiment.action.base; - -public interface IAction { - public void perform(); -} http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e21afa7/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/IExceptionListener.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/IExceptionListener.java b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/IExceptionListener.java deleted file mode 100644 index e6a6cf1..0000000 --- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/IExceptionListener.java +++ /dev/null @@ -1,24 +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.experiment.action.base; - -public interface IExceptionListener { - public void caughtException(Throwable t); -} http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e21afa7/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/ParallelActionSet.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/ParallelActionSet.java b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/ParallelActionSet.java deleted file mode 100644 index 9593307..0000000 --- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/ParallelActionSet.java +++ /dev/null @@ -1,75 +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.experiment.action.base; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Semaphore; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.atomic.AtomicInteger; - -public class ParallelActionSet extends AbstractAction { - - private final ExecutorService executor; - - private final List<IAction> actions; - - public ParallelActionSet() { - executor = Executors.newCachedThreadPool(new ThreadFactory() { - - private final AtomicInteger tid = new AtomicInteger(0); - - @Override - public Thread newThread(Runnable r) { - Thread t = new Thread(r); - t.setDaemon(true); - t.setName("ParallelActionThread " + tid.getAndIncrement()); - return t; - } - }); - actions = new ArrayList<>(); - } - - public void add(IAction action) { - actions.add(action); - } - - @Override - protected void doPerform() throws Exception { - final Semaphore sem = new Semaphore(-(actions.size() - 1)); - for (final IAction a : actions) { - executor.execute(new Runnable() { - - @Override - public void run() { - try { - a.perform(); - } finally { - sem.release(); - } - } - }); - } - sem.acquire(); - } - -} http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e21afa7/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/SequentialActionList.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/SequentialActionList.java b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/SequentialActionList.java deleted file mode 100644 index 4f4e442..0000000 --- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/base/SequentialActionList.java +++ /dev/null @@ -1,42 +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.experiment.action.base; - -import java.util.ArrayList; -import java.util.List; - -public class SequentialActionList extends AbstractAction { - private final List<IAction> actions; - - public SequentialActionList() { - actions = new ArrayList<>(); - } - - public void add(IAction exec) { - actions.add(exec); - } - - @Override - protected void doPerform() throws Exception { - for (IAction e : actions) { - e.perform(); - } - } -} http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e21afa7/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/AbstractExecutableAction.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/AbstractExecutableAction.java b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/AbstractExecutableAction.java deleted file mode 100644 index 3f8a016..0000000 --- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/AbstractExecutableAction.java +++ /dev/null @@ -1,65 +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.experiment.action.derived; - -import java.io.InputStream; -import java.io.StringWriter; -import java.util.Collections; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.apache.commons.io.IOUtils; - -import org.apache.asterix.common.exceptions.AsterixException; -import org.apache.asterix.experiment.action.base.AbstractAction; - -public abstract class AbstractExecutableAction extends AbstractAction { - - private static final Logger LOGGER = Logger.getLogger(AbstractExecutableAction.class.getName()); - - protected Map<String, String> getEnvironment() { - return Collections.<String, String> emptyMap(); - } - - protected abstract String getCommand(); - - protected abstract boolean doExecute(String command, Map<String, String> env) throws Exception; - - protected abstract InputStream getErrorStream(); - - protected abstract InputStream getInputStream(); - - @Override - protected void doPerform() throws Exception { - StringWriter sw = new StringWriter(); - String cmd = getCommand(); - if (!doExecute(cmd, getEnvironment())) { - IOUtils.copy(getErrorStream(), sw); - throw new AsterixException("Error executing command: " + cmd + ".\n Error = " + sw.toString()); - } else { - IOUtils.copy(getInputStream(), sw); - IOUtils.copy(getErrorStream(), sw); - } - if (LOGGER.isLoggable(Level.INFO)) { - LOGGER.info(sw.toString()); - } - } -} http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e21afa7/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/AbstractLocalExecutableAction.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/AbstractLocalExecutableAction.java b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/AbstractLocalExecutableAction.java deleted file mode 100644 index 1bba94f..0000000 --- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/AbstractLocalExecutableAction.java +++ /dev/null @@ -1,54 +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.experiment.action.derived; - -import java.io.InputStream; -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -public abstract class AbstractLocalExecutableAction extends AbstractExecutableAction { - - private final ProcessBuilder pb; - - private Process p; - - protected AbstractLocalExecutableAction() { - pb = new ProcessBuilder(); - } - - protected InputStream getErrorStream() { - return p == null ? null : p.getErrorStream(); - } - - protected InputStream getInputStream() { - return p == null ? null : p.getInputStream(); - } - - @Override - protected boolean doExecute(String command, Map<String, String> env) throws Exception { - List<String> cmd = Arrays.asList(command.split(" ")); - pb.command(cmd); - pb.environment().putAll(env); - p = pb.start(); - int exitVal = p.waitFor(); - return exitVal == 0; - } -} http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e21afa7/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/AbstractRemoteExecutableAction.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/AbstractRemoteExecutableAction.java b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/AbstractRemoteExecutableAction.java deleted file mode 100644 index 8976e7c..0000000 --- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/AbstractRemoteExecutableAction.java +++ /dev/null @@ -1,89 +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.experiment.action.derived; - -import java.io.InputStream; -import java.util.Map; -import java.util.Map.Entry; - -import net.schmizz.sshj.SSHClient; -import net.schmizz.sshj.connection.channel.direct.Session; -import net.schmizz.sshj.connection.channel.direct.Session.Command; - -public abstract class AbstractRemoteExecutableAction extends AbstractExecutableAction { - - private final SSHClient client; - - private final String hostname; - - private final int port; - - private final String username; - - private final String keyLocation; - - private Command cmd; - - protected AbstractRemoteExecutableAction(String hostname, String username, String keyLocation) { - this(hostname, SSHClient.DEFAULT_PORT, username, keyLocation); - } - - protected AbstractRemoteExecutableAction(String hostname, int port, String username, String keyLocation) { - this.hostname = hostname; - this.port = port; - this.username = username; - this.keyLocation = keyLocation; - client = new SSHClient(); - } - - protected InputStream getErrorStream() { - return cmd == null ? null : cmd.getErrorStream(); - } - - protected InputStream getInputStream() { - return cmd == null ? null : cmd.getInputStream(); - } - - @Override - protected boolean doExecute(String command, Map<String, String> env) throws Exception { - int exitVal = 0; - client.loadKnownHosts(); - try { - client.connect(hostname, port); - client.authPublickey(username, keyLocation); - Session s = client.startSession(); - try { - for (Entry<String, String> e : env.entrySet()) { - s.setEnvVar(e.getKey(), e.getValue()); - } - cmd = s.exec(command); - cmd.join(); - Integer ev = cmd.getExitStatus(); - exitVal = ev == null ? -1 : ev; - cmd.close(); - } finally { - s.close(); - } - } finally { - client.close(); - } - return exitVal == 0; - } -} http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e21afa7/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/CloseOutputStreamAction.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/CloseOutputStreamAction.java b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/CloseOutputStreamAction.java deleted file mode 100644 index 66956f4..0000000 --- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/CloseOutputStreamAction.java +++ /dev/null @@ -1,40 +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.experiment.action.derived; - -import java.io.OutputStream; - -import org.apache.asterix.experiment.action.base.AbstractAction; -import org.apache.hyracks.api.util.ExperimentProfilerUtils; - -public class CloseOutputStreamAction extends AbstractAction { - - private final OutputStream os; - - public CloseOutputStreamAction(OutputStream os) { - this.os = os; - } - - @Override - protected void doPerform() throws Exception { - ExperimentProfilerUtils.closeOutputFile(os); - } - -} http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e21afa7/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/ManagixActions.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/ManagixActions.java b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/ManagixActions.java deleted file mode 100644 index 182cdbb..0000000 --- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/ManagixActions.java +++ /dev/null @@ -1,143 +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.experiment.action.derived; - -import java.text.MessageFormat; -import java.util.HashMap; -import java.util.Map; - -public class ManagixActions { - - private enum ManagixCommand { - CONFIGURE("configure"), - CREATE("create", "-n", "-c", "-a"), - START("start", "-n"), - STOP("stop", "-n"), - DELETE("delete", "-n"), - LOG("log", "-n", "-d"), - SHUTDOWN("shutdown"); - - private final String cmdFormat; - - private ManagixCommand(String name, String... options) { - StringBuilder sb = new StringBuilder(); - sb.append(name).append(" "); - if (options != null) { - for (int i = 0; i < options.length; ++i) { - sb.append(options[i]).append(" ").append("{").append(i).append("}"); - if (i != options.length - 1) { - sb.append(" "); - } - } - } - cmdFormat = sb.toString(); - } - - public String getCommandFormat() { - return cmdFormat; - } - } - - private static abstract class AbstractManagixCommandAction extends AbstractLocalExecutableAction { - - private static final String cmdFormat = "{0}/bin/managix {1}"; - - private final String managixHomePath; - - private final String command; - - protected AbstractManagixCommandAction(String managixHomePath, String command) { - this.managixHomePath = managixHomePath; - this.command = command; - } - - @Override - protected String getCommand() { - return MessageFormat.format(cmdFormat, managixHomePath, command); - } - - @Override - protected Map<String, String> getEnvironment() { - Map<String, String> env = new HashMap<>(); - env.put("MANAGIX_HOME", managixHomePath); - return env; - } - - } - - public static class ConfigureAsterixManagixAction extends AbstractManagixCommandAction { - - public ConfigureAsterixManagixAction(String managixHomePath) { - super(managixHomePath, MessageFormat.format(ManagixCommand.CONFIGURE.getCommandFormat(), "")); - } - - } - - public static class CreateAsterixManagixAction extends AbstractManagixCommandAction { - - public CreateAsterixManagixAction(String managixHomePath, String asterixInstanceName, - String clusterConfigFilePath, String asterixConfigFilePath) { - super(managixHomePath, MessageFormat.format(ManagixCommand.CREATE.getCommandFormat(), asterixInstanceName, - clusterConfigFilePath, asterixConfigFilePath)); - } - - } - - public static class StartAsterixManagixAction extends AbstractManagixCommandAction { - - public StartAsterixManagixAction(String managixHomePath, String asterixInstanceName) { - super(managixHomePath, MessageFormat.format(ManagixCommand.START.getCommandFormat(), asterixInstanceName)); - } - - } - - public static class StopAsterixManagixAction extends AbstractManagixCommandAction { - - public StopAsterixManagixAction(String managixHomePath, String asterixInstanceName) { - super(managixHomePath, MessageFormat.format(ManagixCommand.STOP.getCommandFormat(), asterixInstanceName)); - } - - } - - public static class DeleteAsterixManagixAction extends AbstractManagixCommandAction { - - public DeleteAsterixManagixAction(String managixHomePath, String asterixInstanceName) { - super(managixHomePath, MessageFormat.format(ManagixCommand.DELETE.getCommandFormat(), asterixInstanceName)); - } - - } - - public static class LogAsterixManagixAction extends AbstractManagixCommandAction { - - public LogAsterixManagixAction(String managixHomePath, String asterixInstanceName, String destinationDir) { - super(managixHomePath, MessageFormat.format(ManagixCommand.LOG.getCommandFormat(), asterixInstanceName, - destinationDir)); - } - - } - - public static class ShutdownAsterixManagixAction extends AbstractManagixCommandAction { - - public ShutdownAsterixManagixAction(String managixHomePath) { - super(managixHomePath, MessageFormat.format(ManagixCommand.SHUTDOWN.getCommandFormat(), "")); - } - - } -} http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e21afa7/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RemoteAsterixDriverKill.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RemoteAsterixDriverKill.java b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RemoteAsterixDriverKill.java deleted file mode 100644 index 229b8c7..0000000 --- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RemoteAsterixDriverKill.java +++ /dev/null @@ -1,34 +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.experiment.action.derived; - -public class RemoteAsterixDriverKill extends AbstractRemoteExecutableAction { - - public RemoteAsterixDriverKill(String hostname, String username, String keyLocation) { - super(hostname, username, keyLocation); - } - - @Override - protected String getCommand() { - return "ps -ef | awk '/java.*org\\.apache\\.hyracks\\.control\\.[cn]c\\.[CN]CDriver/ {print $2}' " + - "| xargs -n 1 kill -9"; - } - -} http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e21afa7/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RemoteCopyFileAction.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RemoteCopyFileAction.java b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RemoteCopyFileAction.java deleted file mode 100644 index 6768e94..0000000 --- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RemoteCopyFileAction.java +++ /dev/null @@ -1,70 +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.experiment.action.derived; - -import net.schmizz.sshj.SSHClient; -import net.schmizz.sshj.xfer.scp.SCPFileTransfer; -import org.apache.asterix.experiment.action.base.AbstractAction; - -public class RemoteCopyFileAction extends AbstractAction { - - private final String srcFilePath; - - private final String destFilePath; - - private final SSHClient client; - - private final String hostname; - - private final int port; - - private final String username; - - private final String keyLocation; - - public RemoteCopyFileAction(String srcFilePath, String destFilePath, String hostname, String username, - String keyLocation) { - this(srcFilePath, destFilePath, hostname, SSHClient.DEFAULT_PORT, username, keyLocation); - } - - public RemoteCopyFileAction(String srcFilePath, String destFilePath, String hostname, int port, String username, - String keyLocation) { - this.srcFilePath = srcFilePath; - this.destFilePath = destFilePath; - this.hostname = hostname; - this.port = port; - this.username = username; - this.keyLocation = keyLocation; - client = new SSHClient(); - } - - @Override - protected void doPerform() throws Exception { - client.loadKnownHosts(); - try { - client.connect(hostname, port); - client.authPublickey(username, keyLocation); - SCPFileTransfer scpft = client.newSCPFileTransfer(); - scpft.upload(srcFilePath, destFilePath); - } finally { - client.close(); - } - } -} http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e21afa7/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RunAQLFileAction.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RunAQLFileAction.java b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RunAQLFileAction.java deleted file mode 100644 index 2e6772a..0000000 --- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RunAQLFileAction.java +++ /dev/null @@ -1,98 +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.experiment.action.derived; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.text.MessageFormat; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.apache.asterix.experiment.action.base.AbstractAction; -import org.apache.commons.io.IOUtils; -import org.apache.http.HttpEntity; -import org.apache.http.HttpHeaders; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; - -public class RunAQLFileAction extends AbstractAction { - private final Logger LOGGER = Logger.getLogger(RunAQLFileAction.class.getName()); - private static final String REST_URI_TEMPLATE = "http://{0}:{1}/aql"; - - private final HttpClient httpClient; - - private final Path aqlFilePath; - - private final String restHost; - - private final int restPort; - - private final OutputStream os; - - public RunAQLFileAction(HttpClient httpClient, String restHost, int restPort, Path aqlFilePath) { - this.httpClient = httpClient; - this.aqlFilePath = aqlFilePath; - this.restHost = restHost; - this.restPort = restPort; - os = null; - } - - public RunAQLFileAction(HttpClient httpClient, String restHost, int restPort, Path aqlFilePath, OutputStream os) { - this.httpClient = httpClient; - this.aqlFilePath = aqlFilePath; - this.restHost = restHost; - this.restPort = restPort; - this.os = os; - } - - @Override - public void doPerform() throws Exception { - String aql = StandardCharsets.UTF_8.decode(ByteBuffer.wrap(Files.readAllBytes(aqlFilePath))).toString(); - String uri = MessageFormat.format(REST_URI_TEMPLATE, restHost, String.valueOf(restPort)); - HttpPost post = new HttpPost(uri); - post.setHeader(HttpHeaders.CONTENT_TYPE, "application/json"); - post.setEntity(new StringEntity(aql, StandardCharsets.UTF_8)); - HttpEntity entity = httpClient.execute(post).getEntity(); - if (entity != null && entity.isStreaming()) { - printStream(entity.getContent()); - } - if (aql.contains("compact")) { - if (LOGGER.isLoggable(Level.INFO)) { - LOGGER.info("Compaction has been completed"); - } - } - } - - private void printStream(InputStream content) throws IOException { - if (os == null) { - IOUtils.copy(content, System.out); - System.out.flush(); - } else { - IOUtils.copy(content, os); - os.flush(); - } - } -} http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e21afa7/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RunAQLStringAction.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RunAQLStringAction.java b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RunAQLStringAction.java deleted file mode 100644 index 1785e75..0000000 --- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RunAQLStringAction.java +++ /dev/null @@ -1,86 +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.experiment.action.derived; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.nio.charset.StandardCharsets; -import java.text.MessageFormat; - -import org.apache.asterix.experiment.action.base.AbstractAction; -import org.apache.commons.io.IOUtils; -import org.apache.http.HttpEntity; -import org.apache.http.HttpHeaders; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; - -public class RunAQLStringAction extends AbstractAction { - private static final String REST_URI_TEMPLATE = "http://{0}:{1}/aql"; - - private final HttpClient httpClient; - - private final String aql; - - private final String restHost; - - private final int restPort; - - private final OutputStream os; - - public RunAQLStringAction(HttpClient httpClient, String restHost, int restPort, String aql) { - this.httpClient = httpClient; - this.aql = aql; - this.restHost = restHost; - this.restPort = restPort; - os = null; - } - - public RunAQLStringAction(HttpClient httpClient, String restHost, int restPort, String aql, OutputStream os) { - this.httpClient = httpClient; - this.aql = aql; - this.restHost = restHost; - this.restPort = restPort; - this.os = os; - } - - @Override - public void doPerform() throws Exception { - String uri = MessageFormat.format(REST_URI_TEMPLATE, restHost, String.valueOf(restPort)); - HttpPost post = new HttpPost(uri); - post.setHeader(HttpHeaders.CONTENT_TYPE, "application/json"); - post.setEntity(new StringEntity(aql, StandardCharsets.UTF_8)); - HttpEntity entity = httpClient.execute(post).getEntity(); - if (entity != null && entity.isStreaming()) { - printStream(entity.getContent()); - } - } - - private void printStream(InputStream content) throws IOException { - if (os == null) { - IOUtils.copy(content, System.out); - System.out.flush(); - } else { - IOUtils.copy(content, os); - os.flush(); - } - } -} http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e21afa7/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RunRESTIOWaitAction.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RunRESTIOWaitAction.java b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RunRESTIOWaitAction.java deleted file mode 100644 index 9646d32..0000000 --- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RunRESTIOWaitAction.java +++ /dev/null @@ -1,54 +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.experiment.action.derived; - -import java.text.MessageFormat; - -import org.apache.http.HttpEntity; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.util.EntityUtils; - -import org.apache.asterix.experiment.action.base.AbstractAction; - -public class RunRESTIOWaitAction extends AbstractAction { - private static final String REST_URI_TEMPLATE = "http://{0}:{1}/iowait"; - - private final HttpClient httpClient; - - private final String restHost; - - private final int restPort; - - public RunRESTIOWaitAction(HttpClient httpClient, String restHost, int restPort) { - this.httpClient = httpClient; - this.restHost = restHost; - this.restPort = restPort; - } - - @Override - public void doPerform() throws Exception { - String uri = MessageFormat.format(REST_URI_TEMPLATE, restHost, String.valueOf(restPort)); - HttpGet get = new HttpGet(uri); - HttpEntity entity = httpClient.execute(get).getEntity(); - EntityUtils.consume(entity); - } - -} http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e21afa7/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RunSQLPPFileAction.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RunSQLPPFileAction.java b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RunSQLPPFileAction.java deleted file mode 100644 index 8e44b0d..0000000 --- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RunSQLPPFileAction.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.asterix.experiment.action.derived; - -import org.apache.asterix.experiment.action.base.AbstractAction; -import org.apache.avro.generic.GenericData; -import org.apache.commons.httpclient.HttpException; -import org.apache.commons.httpclient.HttpStatus; -import org.apache.commons.io.IOUtils; -import org.apache.http.HttpEntity; -import org.apache.http.HttpHeaders; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.util.EntityUtils; - -import java.io.*; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; - -public class RunSQLPPFileAction extends AbstractAction { - private static final String REST_URI_TEMPLATE = "http://{0}:{1}/sqlpp"; - - private final HttpClient httpClient; - - private final Path aqlFilePath; - private final Path csvFilePath; - private final List<Path> queriesToRun; - - private final String restHost; - - private final int restPort; - - public RunSQLPPFileAction(HttpClient httpClient, String restHost, int restPort, Path aqlFilePath, Path csvFilePath) { - this.httpClient = httpClient; - this.aqlFilePath = aqlFilePath; - this.csvFilePath = csvFilePath; - this.restHost = restHost; - this.restPort = restPort; - queriesToRun = new ArrayList<>(); - } - - @Override - public void doPerform() throws Exception { - FileOutputStream csvFileOut = new FileOutputStream(csvFilePath.toFile()); - PrintWriter printer = new PrintWriter(csvFileOut, true); - try { - if (aqlFilePath.toFile().isDirectory()) { - for (File f : aqlFilePath.toFile().listFiles()) { - queriesToRun.add(f.toPath()); - } - } else { - queriesToRun.add(aqlFilePath); - } - - for (Path p : queriesToRun) { - String sqlpp = StandardCharsets.UTF_8.decode(ByteBuffer.wrap(Files.readAllBytes(p))).toString(); - String uri = MessageFormat.format(REST_URI_TEMPLATE, restHost, String.valueOf(restPort)); - HttpPost post = new HttpPost(uri); - post.setHeader(HttpHeaders.CONTENT_TYPE, "application/json"); - post.setEntity(new StringEntity(sqlpp, StandardCharsets.UTF_8)); - long start = System.currentTimeMillis(); - HttpResponse resp = httpClient.execute(post); - HttpEntity entity = resp.getEntity(); - if (resp.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { - throw new HttpException("Query returned error" + EntityUtils.toString(entity)); - } - EntityUtils.consume(entity); - long end = System.currentTimeMillis(); - long wallClock = end - start; - String currLine = p.getFileName().toString() + ',' + wallClock; - System.out.println(currLine); - printer.print(currLine + '\n'); - } - } - finally{ - printer.close(); - } - } -} http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e21afa7/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/SleepAction.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/SleepAction.java b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/SleepAction.java deleted file mode 100644 index 5200c8b..0000000 --- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/SleepAction.java +++ /dev/null @@ -1,37 +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.experiment.action.derived; - -import org.apache.asterix.experiment.action.base.AbstractAction; - -public class SleepAction extends AbstractAction { - - private final long ms; - - public SleepAction(long ms) { - this.ms = ms; - } - - @Override - protected void doPerform() throws Exception { - Thread.sleep(ms); - } - -} http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e21afa7/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/StartDataGeneratorAction.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/StartDataGeneratorAction.java b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/StartDataGeneratorAction.java deleted file mode 100644 index f0d51ac..0000000 --- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/StartDataGeneratorAction.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.asterix.experiment.action.derived; - -import java.io.StringWriter; - -import net.schmizz.sshj.SSHClient; -import net.schmizz.sshj.connection.channel.direct.Session; -import net.schmizz.sshj.connection.channel.direct.Session.Command; - -import org.apache.commons.io.IOUtils; - -import org.apache.asterix.experiment.action.base.AbstractAction; - -public class StartDataGeneratorAction extends AbstractAction { - - @Override - protected void doPerform() throws Exception { - } - - public static void main(String[] args) throws Exception { - SSHClient sshClient = new SSHClient(); - sshClient.loadKnownHosts(); - sshClient.connect("asterix-1.ics.uci.edu"); - sshClient.authPublickey("zheilbro", "/Users/zheilbron/.ssh/id_rsa"); - Session session = sshClient.startSession(); - Command lsCmd = session.exec("ls"); - StringWriter sw = new StringWriter(); - IOUtils.copy(lsCmd.getInputStream(), sw); - IOUtils.copy(lsCmd.getErrorStream(), sw); - System.out.println(sw.toString()); - session.close(); - sw.close(); - sshClient.close(); - } -}
