Search in sources :

Example 6 with AbstractRemoteExecutableAction

use of org.apache.asterix.experiment.action.derived.AbstractRemoteExecutableAction in project asterixdb by apache.

the class AbstractExperiment7Builder method doBuildDataGen.

@Override
protected void doBuildDataGen(SequentialActionList seq, Map<String, List<String>> dgenPairs) throws Exception {
    int nDgens = 0;
    for (List<String> v : dgenPairs.values()) {
        nDgens += v.size();
    }
    final OrchestratorServer7 oServer = new OrchestratorServer7(orchPort, nDgens, nIntervals, new ProtocolActionBuilder(), this.lsAction);
    seq.add(new AbstractAction() {

        @Override
        protected void doPerform() throws Exception {
            oServer.start();
        }
    });
    ParallelActionSet dgenActions = new ParallelActionSet();
    int partition = 0;
    // run dgen
    for (String dgenHost : dgenPairs.keySet()) {
        final List<String> rcvrs = dgenPairs.get(dgenHost);
        final int p = partition;
        dgenActions.add(new AbstractRemoteExecutableAction(dgenHost, username, sshKeyLocation) {

            @Override
            protected String getCommand() {
                String ipPortPairs = StringUtils.join(rcvrs.iterator(), " ");
                String binary = "JAVA_HOME=" + javaHomePath + " " + localExperimentRoot.resolve("bin").resolve("datagenrunner").toString();
                return StringUtils.join(new String[] { binary, "-si", "" + locationSampleInterval, "-of", openStreetMapFilePath, "-p", "" + p, "-di", "" + dataInterval, "-ni", "" + nIntervals, "-oh", orchHost, "-op", "" + orchPort, ipPortPairs }, " ");
            }
        });
        partition += rcvrs.size();
    }
    seq.add(dgenActions);
    // wait until all dgen / queries are done
    seq.add(new AbstractAction() {

        @Override
        protected void doPerform() throws Exception {
            oServer.awaitFinished();
        }
    });
}
Also used : OrchestratorServer7(org.apache.asterix.experiment.client.OrchestratorServer7) IProtocolActionBuilder(org.apache.asterix.experiment.client.OrchestratorServer7.IProtocolActionBuilder) AbstractRemoteExecutableAction(org.apache.asterix.experiment.action.derived.AbstractRemoteExecutableAction) AbstractAction(org.apache.asterix.experiment.action.base.AbstractAction) IOException(java.io.IOException) ParallelActionSet(org.apache.asterix.experiment.action.base.ParallelActionSet)

Example 7 with AbstractRemoteExecutableAction

use of org.apache.asterix.experiment.action.derived.AbstractRemoteExecutableAction in project asterixdb by apache.

the class AbstractExperiment8Builder method doBuildDataGen.

@Override
protected void doBuildDataGen(SequentialActionList seq, Map<String, List<String>> dgenPairs) throws Exception {
    //start datagen
    SequentialActionList[] protocolActions = new SequentialActionList[nIntervals];
    for (int i = 0; i < nIntervals; i++) {
        protocolActions[i] = new SequentialActionList();
        protocolActions[i].add(new SleepAction(10000));
        protocolActions[i].add(new RunRESTIOWaitAction(httpClient, restHost, restPort));
        protocolActions[i].add(new SleepAction(10000));
        doBuildProtocolAction(protocolActions[i], i);
    }
    int nDgens = 0;
    for (List<String> v : dgenPairs.values()) {
        nDgens += v.size();
    }
    final OrchestratorServer oServer = new OrchestratorServer(orchPort, nDgens, nIntervals, protocolActions);
    seq.add(new AbstractAction() {

        @Override
        protected void doPerform() throws Exception {
            oServer.start();
        }
    });
    ParallelActionSet dgenActions = new ParallelActionSet();
    int partition = 0;
    // run dgen
    for (String dgenHost : dgenPairs.keySet()) {
        final List<String> rcvrs = dgenPairs.get(dgenHost);
        final int p = partition;
        dgenActions.add(new AbstractRemoteExecutableAction(dgenHost, username, sshKeyLocation) {

            @Override
            protected String getCommand() {
                String ipPortPairs = StringUtils.join(rcvrs.iterator(), " ");
                String binary = "JAVA_HOME=" + javaHomePath + " " + localExperimentRoot.resolve("bin").resolve("datagenrunner").toString();
                return StringUtils.join(new String[] { binary, "-si", "" + locationSampleInterval, "-of", openStreetMapFilePath, "-p", "" + p, "-di", "" + dataInterval, "-ni", "" + nIntervals, "-oh", orchHost, "-op", "" + orchPort, ipPortPairs }, " ");
            }
        });
        partition += rcvrs.size();
    }
    seq.add(dgenActions);
    // wait until all dgen / queries are done
    seq.add(new AbstractAction() {

        @Override
        protected void doPerform() throws Exception {
            oServer.awaitFinished();
        }
    });
}
Also used : OrchestratorServer(org.apache.asterix.experiment.client.OrchestratorServer) SleepAction(org.apache.asterix.experiment.action.derived.SleepAction) AbstractRemoteExecutableAction(org.apache.asterix.experiment.action.derived.AbstractRemoteExecutableAction) IOException(java.io.IOException) ParallelActionSet(org.apache.asterix.experiment.action.base.ParallelActionSet) RunRESTIOWaitAction(org.apache.asterix.experiment.action.derived.RunRESTIOWaitAction) SequentialActionList(org.apache.asterix.experiment.action.base.SequentialActionList) AbstractAction(org.apache.asterix.experiment.action.base.AbstractAction)

Example 8 with AbstractRemoteExecutableAction

use of org.apache.asterix.experiment.action.derived.AbstractRemoteExecutableAction in project asterixdb by apache.

the class AbstractLSMBaseExperimentBuilder method doBuildDataGen.

protected void doBuildDataGen(SequentialActionList seq, final Map<String, List<String>> dgenPairs) throws Exception {
    //start datagen
    ParallelActionSet dgenActions = new ParallelActionSet();
    int partition = 0;
    for (String dgenHost : dgenPairs.keySet()) {
        final List<String> rcvrs = dgenPairs.get(dgenHost);
        final int p = partition;
        dgenActions.add(new AbstractRemoteExecutableAction(dgenHost, username, sshKeyLocation) {

            @Override
            protected String getCommand() {
                String ipPortPairs = StringUtils.join(rcvrs.iterator(), " ");
                String binary = "JAVA_HOME=" + javaHomePath + " " + localExperimentRoot.resolve("bin").resolve("datagenrunner").toString();
                if (openStreetMapFilePath == null) {
                    return StringUtils.join(new String[] { binary, "-rcbi", "" + recordCountPerBatchDuringIngestionOnly, "-rcbq", "" + recordCountPerBatchDuringQuery, "-dsti", "" + dataGenSleepTimeDuringIngestionOnly, "-dstq", "" + dataGenSleepTimeDuringQuery, "-si", "" + locationSampleInterval, "-p", "" + p, "-d", "" + duration, ipPortPairs }, " ");
                } else {
                    return StringUtils.join(new String[] { binary, "-rcbi", "" + recordCountPerBatchDuringIngestionOnly, "-rcbq", "" + recordCountPerBatchDuringQuery, "-dsti", "" + dataGenSleepTimeDuringIngestionOnly, "-dstq", "" + dataGenSleepTimeDuringQuery, "-si", "" + locationSampleInterval, "-of", openStreetMapFilePath, "-p", "" + p, "-d", "" + duration, ipPortPairs }, " ");
                }
            }
        });
        partition += rcvrs.size();
    }
    seq.add(dgenActions);
}
Also used : AbstractRemoteExecutableAction(org.apache.asterix.experiment.action.derived.AbstractRemoteExecutableAction) ParallelActionSet(org.apache.asterix.experiment.action.base.ParallelActionSet)

Aggregations

ParallelActionSet (org.apache.asterix.experiment.action.base.ParallelActionSet)8 AbstractRemoteExecutableAction (org.apache.asterix.experiment.action.derived.AbstractRemoteExecutableAction)8 IOException (java.io.IOException)4 AbstractAction (org.apache.asterix.experiment.action.base.AbstractAction)4 SequentialActionList (org.apache.asterix.experiment.action.base.SequentialActionList)4 SleepAction (org.apache.asterix.experiment.action.derived.SleepAction)4 File (java.io.File)3 ArrayList (java.util.ArrayList)3 HashSet (java.util.HashSet)3 List (java.util.List)3 JAXBContext (javax.xml.bind.JAXBContext)3 Unmarshaller (javax.xml.bind.Unmarshaller)3 Cluster (org.apache.asterix.event.schema.cluster.Cluster)3 LogAsterixManagixAction (org.apache.asterix.experiment.action.derived.ManagixActions.LogAsterixManagixAction)3 StopAsterixManagixAction (org.apache.asterix.experiment.action.derived.ManagixActions.StopAsterixManagixAction)3 RemoteAsterixDriverKill (org.apache.asterix.experiment.action.derived.RemoteAsterixDriverKill)3 RunAQLFileAction (org.apache.asterix.experiment.action.derived.RunAQLFileAction)3 CreateAsterixManagixAction (org.apache.asterix.experiment.action.derived.ManagixActions.CreateAsterixManagixAction)2 DeleteAsterixManagixAction (org.apache.asterix.experiment.action.derived.ManagixActions.DeleteAsterixManagixAction)2 TimedAction (org.apache.asterix.experiment.action.derived.TimedAction)2