Search in sources :

Example 11 with ExecutionRuntime

use of edu.iu.dsc.tws.executor.core.ExecutionRuntime in project twister2 by DSC-SPIDAL.

the class DataFileReplicatedReadSource method prepare.

public void prepare(Config cfg, TaskContext context) {
    super.prepare(cfg, context);
    ExecutionRuntime runtime = (ExecutionRuntime) cfg.get(ExecutorContext.TWISTER2_RUNTIME_OBJECT);
    this.source = runtime.createInput(cfg, context, new LocalCompleteTextInputPartitioner(new Path(getDataDirectory()), context.getParallelism(), config));
}
Also used : Path(edu.iu.dsc.tws.api.data.Path) LocalCompleteTextInputPartitioner(edu.iu.dsc.tws.data.api.formatters.LocalCompleteTextInputPartitioner) ExecutionRuntime(edu.iu.dsc.tws.executor.core.ExecutionRuntime)

Example 12 with ExecutionRuntime

use of edu.iu.dsc.tws.executor.core.ExecutionRuntime in project twister2 by DSC-SPIDAL.

the class DataFileSplittedReadSource method prepare.

/**
 * Retrieve the data input directory using the DataObjectConstants and the config file.
 * @param cfg
 * @param context
 */
@Override
public void prepare(Config cfg, TaskContext context) {
    super.prepare(cfg, context);
    ExecutionRuntime runtime = (ExecutionRuntime) cfg.get(ExecutorContext.TWISTER2_RUNTIME_OBJECT);
    this.source = runtime.createInput(cfg, context, new LocalTextInputPartitioner(new Path(getDataDirectory()), context.getParallelism(), config));
}
Also used : LocalTextInputPartitioner(edu.iu.dsc.tws.data.api.formatters.LocalTextInputPartitioner) Path(edu.iu.dsc.tws.api.data.Path) ExecutionRuntime(edu.iu.dsc.tws.executor.core.ExecutionRuntime)

Example 13 with ExecutionRuntime

use of edu.iu.dsc.tws.executor.core.ExecutionRuntime in project twister2 by DSC-SPIDAL.

the class BatchSharingExecutor2 method iExecute.

public IExecution iExecute() {
    executionHook.beforeExecution();
    // lets create the runtime object
    ExecutionRuntime runtime = new ExecutionRuntime(ExecutorContext.jobName(config), plan, channel);
    // updated config
    this.config = Config.newBuilder().putAll(config).put(ExecutorContext.TWISTER2_RUNTIME_OBJECT, runtime).build();
    // if this is a previously executed plan we have to reset the nodes
    if (plan.getExecutionState() == ExecutionState.EXECUTED) {
        resetNodes(plan.getNodes(), plan.getParallelOperations());
    }
    // go through the instances
    return runIExecution();
}
Also used : ExecutionRuntime(edu.iu.dsc.tws.executor.core.ExecutionRuntime)

Example 14 with ExecutionRuntime

use of edu.iu.dsc.tws.executor.core.ExecutionRuntime in project twister2 by DSC-SPIDAL.

the class BatchSharingExecutor2 method execute.

public boolean execute() {
    executionHook.beforeExecution();
    // lets create the runtime object
    ExecutionRuntime runtime = new ExecutionRuntime(ExecutorContext.jobName(config), plan, channel);
    // updated config
    this.config = Config.newBuilder().putAll(config).put(ExecutorContext.TWISTER2_RUNTIME_OBJECT, runtime).build();
    // if this is a previously executed plan we have to reset the nodes
    if (plan.getExecutionState() == ExecutionState.EXECUTED) {
        resetNodes(plan.getNodes(), plan.getParallelOperations());
    }
    // go through the instances
    return runExecution(plan);
}
Also used : ExecutionRuntime(edu.iu.dsc.tws.executor.core.ExecutionRuntime)

Example 15 with ExecutionRuntime

use of edu.iu.dsc.tws.executor.core.ExecutionRuntime in project twister2 by DSC-SPIDAL.

the class ThreadSharingExecutor method execute.

public boolean execute() {
    // run the execution hook
    executionHook.beforeExecution();
    // lets create the runtime object
    ExecutionRuntime runtime = new ExecutionRuntime(ExecutorContext.jobName(config), executionPlan, channel);
    // updated config
    this.config = Config.newBuilder().putAll(config).put(ExecutorContext.TWISTER2_RUNTIME_OBJECT, runtime).build();
    // go through the instances
    return runExecution();
}
Also used : ExecutionRuntime(edu.iu.dsc.tws.executor.core.ExecutionRuntime)

Aggregations

ExecutionRuntime (edu.iu.dsc.tws.executor.core.ExecutionRuntime)16 Path (edu.iu.dsc.tws.api.data.Path)8 LocalTextInputPartitioner (edu.iu.dsc.tws.data.api.formatters.LocalTextInputPartitioner)4 LocalCSVInputPartitioner (edu.iu.dsc.tws.data.api.formatters.LocalCSVInputPartitioner)2 LocalCompleteTextInputPartitioner (edu.iu.dsc.tws.data.api.formatters.LocalCompleteTextInputPartitioner)2 LocalFixedInputPartitioner (edu.iu.dsc.tws.data.api.formatters.LocalFixedInputPartitioner)2 LocalCompleteCSVInputPartitioner (edu.iu.dsc.tws.data.api.formatters.LocalCompleteCSVInputPartitioner)1 SharedTextInputPartitioner (edu.iu.dsc.tws.data.api.formatters.SharedTextInputPartitioner)1 TextOutputWriter (edu.iu.dsc.tws.data.api.out.TextOutputWriter)1