use of edu.iu.dsc.tws.api.comms.messaging.types.MessageType in project twister2 by DSC-SPIDAL.
the class DataSerializerTest method testBuildLargeShortMessage.
@Test
public void testBuildLargeShortMessage() {
int numBuffers = 10;
int size = 1000;
MessageType type = MessageTypes.SHORT_ARRAY;
Object data = createData(800, type);
InMessage inMessage = singleValueCase(numBuffers, size, type, data);
Assert.assertArrayEquals((short[]) inMessage.getDeserializedData(), (short[]) data);
}
use of edu.iu.dsc.tws.api.comms.messaging.types.MessageType in project twister2 by DSC-SPIDAL.
the class STGatherExample method buildTaskGraph.
@Override
public ComputeGraphBuilder buildTaskGraph() {
List<Integer> taskStages = jobParameters.getTaskStages();
int sourceParallelism = taskStages.get(0);
int sinkParallelism = taskStages.get(1);
MessageType dataType = MessageTypes.INTEGER_ARRAY;
String edge = "edge";
BaseSource g = new SourceTask(edge);
ICompute r = new GatherSinkTask();
computeGraphBuilder.addSource(SOURCE, g, sourceParallelism);
computeConnection = computeGraphBuilder.addCompute(SINK, r, sinkParallelism);
computeConnection.gather(SOURCE).viaEdge(edge).withDataType(dataType);
return computeGraphBuilder;
}
use of edu.iu.dsc.tws.api.comms.messaging.types.MessageType in project twister2 by DSC-SPIDAL.
the class STKeyedReduceExample method buildTaskGraph.
@Override
public ComputeGraphBuilder buildTaskGraph() {
List<Integer> taskStages = jobParameters.getTaskStages();
int sourceParallelism = taskStages.get(0);
int sinkParallelism = taskStages.get(1);
Op operation = Op.SUM;
MessageType keyType = MessageTypes.INTEGER;
MessageType dataType = MessageTypes.INTEGER_ARRAY;
String edge = "edge";
BaseSource g = new SourceTask(edge, true);
ICompute r = new KeyedReduceSinkTask();
computeGraphBuilder.addSource(SOURCE, g, sourceParallelism);
computeConnection = computeGraphBuilder.addCompute(SINK, r, sinkParallelism);
computeConnection.keyedReduce(SOURCE).viaEdge(edge).withOperation(operation, dataType).withKeyType(keyType);
return computeGraphBuilder;
}
use of edu.iu.dsc.tws.api.comms.messaging.types.MessageType in project twister2 by DSC-SPIDAL.
the class STPartitionKeyedExample method buildTaskGraph.
@Override
public ComputeGraphBuilder buildTaskGraph() {
List<Integer> taskStages = jobParameters.getTaskStages();
int sourceParallelism = taskStages.get(0);
int sinkParallelism = taskStages.get(1);
MessageType keyType = MessageTypes.INTEGER;
MessageType dataType = MessageTypes.INTEGER_ARRAY;
String edge = "edge";
BaseSource g = new SourceTask(edge, true);
ICompute r = new SKeyedPartitionSinkTask();
computeGraphBuilder.addSource(SOURCE, g, sourceParallelism);
computeConnection = computeGraphBuilder.addCompute(SINK, r, sinkParallelism);
computeConnection.keyedPartition(SOURCE).viaEdge(edge).withKeyType(keyType).withDataType(dataType);
return computeGraphBuilder;
}
use of edu.iu.dsc.tws.api.comms.messaging.types.MessageType in project twister2 by DSC-SPIDAL.
the class BTKeyedReduceExample method buildTaskGraph.
@Override
public ComputeGraphBuilder buildTaskGraph() {
List<Integer> taskStages = jobParameters.getTaskStages();
int sourceParallelsim = taskStages.get(0);
int sinkParallelism = taskStages.get(1);
Op operation = Op.SUM;
MessageType keyType = MessageTypes.INTEGER;
MessageType dataType = MessageTypes.INTEGER_ARRAY;
String edge = "edge";
BaseSource g = new SourceTask(edge, true);
ICompute r = new KeyedReduceSinkTask();
computeGraphBuilder.addSource(SOURCE, g, sourceParallelsim);
computeConnection = computeGraphBuilder.addCompute(SINK, r, sinkParallelism);
computeConnection.keyedReduce(SOURCE).viaEdge(edge).withOperation(operation, dataType).withKeyType(keyType);
return computeGraphBuilder;
}
Aggregations