Search in sources :

Example 6 with ExecutionRuntime

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

the class PointDataSource method prepare.

@Override
public void prepare(Config cfg, TaskContext context) {
    super.prepare(cfg, context);
    ExecutionRuntime runtime = (ExecutionRuntime) cfg.get(ExecutorContext.TWISTER2_RUNTIME_OBJECT);
    if ("txt".equals(fileType)) {
        if ("points".equals(inputKey)) {
            this.source = runtime.createInput(cfg, context, new LocalTextInputPartitioner(new Path(dataDirectory), context.getParallelism(), cfg));
        } else {
            this.source = runtime.createInput(cfg, context, new LocalCompleteTextInputPartitioner(new Path(dataDirectory), context.getParallelism(), cfg));
        }
    } else {
        if ("points".equals(inputKey)) {
            this.source = runtime.createInput(cfg, context, new LocalCSVInputPartitioner(new Path(dataDirectory), context.getParallelism(), datasize, cfg));
        } else {
            this.source = runtime.createInput(cfg, context, new LocalCompleteCSVInputPartitioner(new Path(dataDirectory), context.getParallelism(), datasize, cfg));
        }
    }
}
Also used : LocalTextInputPartitioner(edu.iu.dsc.tws.data.api.formatters.LocalTextInputPartitioner) Path(edu.iu.dsc.tws.api.data.Path) LocalCompleteTextInputPartitioner(edu.iu.dsc.tws.data.api.formatters.LocalCompleteTextInputPartitioner) LocalCompleteCSVInputPartitioner(edu.iu.dsc.tws.data.api.formatters.LocalCompleteCSVInputPartitioner) LocalCSVInputPartitioner(edu.iu.dsc.tws.data.api.formatters.LocalCSVInputPartitioner) ExecutionRuntime(edu.iu.dsc.tws.executor.core.ExecutionRuntime)

Example 7 with ExecutionRuntime

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

the class DataObjectSource method prepare.

@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(), cfg));
}
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 8 with ExecutionRuntime

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

the class DataParallelTask method prepare.

@Override
public void prepare(Config cfg, TaskContext context) {
    super.prepare(cfg, context);
    String directory = cfg.getStringValue(Constants.ARGS_INPUT_DIRECTORY);
    ExecutionRuntime runtime = (ExecutionRuntime) config.get(ExecutorContext.TWISTER2_RUNTIME_OBJECT);
    String outDir = cfg.getStringValue(Constants.ARGS_OUTPUT_DIRECTORY);
    boolean shared = cfg.getBooleanValue(Constants.ARGS_SHARED_FILE_SYSTEM);
    if (!shared) {
        this.source = runtime.createInput(cfg, context, new LocalTextInputPartitioner(new Path(directory), context.getParallelism()));
    } else {
        this.source = runtime.createInput(cfg, context, new SharedTextInputPartitioner(new Path(directory)));
    }
    this.sink = new DataSink<String>(cfg, new TextOutputWriter(FileSystem.WriteMode.OVERWRITE, new Path(outDir)));
}
Also used : LocalTextInputPartitioner(edu.iu.dsc.tws.data.api.formatters.LocalTextInputPartitioner) Path(edu.iu.dsc.tws.api.data.Path) SharedTextInputPartitioner(edu.iu.dsc.tws.data.api.formatters.SharedTextInputPartitioner) TextOutputWriter(edu.iu.dsc.tws.data.api.out.TextOutputWriter) ExecutionRuntime(edu.iu.dsc.tws.executor.core.ExecutionRuntime)

Example 9 with ExecutionRuntime

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

the class SVMDataObjectSource method prepare.

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

Example 10 with ExecutionRuntime

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

the class DataObjectCSVSource method prepare.

@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 LocalCSVInputPartitioner(new Path(getDataDirectory()), context.getParallelism(), cfg));
}
Also used : Path(edu.iu.dsc.tws.api.data.Path) LocalCSVInputPartitioner(edu.iu.dsc.tws.data.api.formatters.LocalCSVInputPartitioner) 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