mirror of
https://github.com/wassname/ray.git
synced 2026-06-27 22:53:20 +08:00
[Streaming] Streaming scheduler - part1-2: execution graph (#6666)
This commit is contained in:
+1
@@ -32,6 +32,7 @@ public class DataStreamSource<T> extends DataStream<T> implements StreamSource<T
|
||||
return new DataStreamSource(context, new CollectionSourceFunction(values));
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataStreamSource<T> setParallelism(int parallelism) {
|
||||
this.parallelism = parallelism;
|
||||
return this;
|
||||
|
||||
@@ -4,7 +4,6 @@ import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ public class JobGraphBuilder {
|
||||
} else if (stream instanceof StreamSource) {
|
||||
jobVertex = new JobVertex(vertexId, parallelism, VertexType.SOURCE, streamOperator);
|
||||
} else if (stream instanceof DataStream || stream instanceof PythonDataStream) {
|
||||
jobVertex = new JobVertex(vertexId, parallelism, VertexType.PROCESS, streamOperator);
|
||||
jobVertex = new JobVertex(vertexId, parallelism, VertexType.TRANSFORMATION, streamOperator);
|
||||
Stream parentStream = stream.getInputStream();
|
||||
int inputVertexId = parentStream.getId();
|
||||
JobEdge jobEdge = new JobEdge(inputVertexId, vertexId, parentStream.getPartition());
|
||||
|
||||
@@ -47,4 +47,5 @@ public class JobVertex implements Serializable {
|
||||
.add("streamOperator", streamOperator)
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,6 +6,6 @@ package org.ray.streaming.jobgraph;
|
||||
public enum VertexType {
|
||||
MASTER,
|
||||
SOURCE,
|
||||
PROCESS,
|
||||
TRANSFORMATION,
|
||||
SINK,
|
||||
}
|
||||
|
||||
-1
@@ -14,7 +14,6 @@ public abstract class StreamOperator<F extends Function> implements Operator {
|
||||
protected List<Collector> collectorList;
|
||||
protected RuntimeContext runtimeContext;
|
||||
|
||||
|
||||
public StreamOperator(F function) {
|
||||
this.name = getClass().getSimpleName();
|
||||
this.function = function;
|
||||
|
||||
+1
-2
@@ -8,7 +8,6 @@ import org.ray.streaming.api.partition.impl.RoundRobinPartition;
|
||||
import org.ray.streaming.api.stream.DataStream;
|
||||
import org.ray.streaming.api.stream.DataStreamSource;
|
||||
import org.ray.streaming.api.stream.StreamSink;
|
||||
import org.ray.streaming.api.stream.StreamSource;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.testng.Assert;
|
||||
@@ -62,7 +61,7 @@ public class JobGraphBuilderTest {
|
||||
JobVertex sink = jobVertexList.get(2);
|
||||
|
||||
Assert.assertEquals(source.getVertexType(), VertexType.SOURCE);
|
||||
Assert.assertEquals(map.getVertexType(), VertexType.PROCESS);
|
||||
Assert.assertEquals(map.getVertexType(), VertexType.TRANSFORMATION);
|
||||
Assert.assertEquals(sink.getVertexType(), VertexType.SINK);
|
||||
|
||||
JobEdge keyBy2Sink = jobEdgeList.get(0);
|
||||
|
||||
Reference in New Issue
Block a user