use of edu.iu.dsc.tws.data.api.formatters.LocalCompleteCSVInputPartitioner 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));
}
}
}
use of edu.iu.dsc.tws.data.api.formatters.LocalCompleteCSVInputPartitioner in project twister2 by DSC-SPIDAL.
the class TextBasedSourceFunction method prepare.
@Override
public void prepare(TSetContext context) {
super.prepare(context);
this.ctx = context;
Config cfg = ctx.getConfig();
if ("complete".equals(partitionerType)) {
this.dataSource = new DataSource(cfg, new LocalCompleteCSVInputPartitioner(new Path(datainputDirectory), context.getParallelism(), dataSize, cfg), parallel);
} else {
this.dataSource = new DataSource(cfg, new LocalCSVInputPartitioner(new Path(datainputDirectory), parallel, dataSize, cfg), parallel);
}
this.dataSplit = this.dataSource.getNextSplit(context.getIndex());
}
Aggregations