forked from apache/flink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-16960][runtime] Add PipelinedRegion interface
This closes apache#11647.
- Loading branch information
Showing
8 changed files
with
183 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...time/src/main/java/org/apache/flink/runtime/jobgraph/topology/LogicalPipelinedRegion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http:https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.apache.flink.runtime.jobgraph.topology; | ||
|
||
import org.apache.flink.runtime.jobgraph.IntermediateDataSetID; | ||
import org.apache.flink.runtime.jobgraph.JobVertex; | ||
import org.apache.flink.runtime.jobgraph.JobVertexID; | ||
import org.apache.flink.runtime.topology.PipelinedRegion; | ||
|
||
/** | ||
* Pipelined region on logical level, i.e., {@link JobVertex} level. | ||
*/ | ||
public interface LogicalPipelinedRegion<V extends LogicalVertex<V, R>, R extends LogicalResult<V, R>> extends PipelinedRegion<JobVertexID, IntermediateDataSetID, V, R> { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
.../src/main/java/org/apache/flink/runtime/scheduler/strategy/SchedulingPipelinedRegion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http:https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.apache.flink.runtime.scheduler.strategy; | ||
|
||
import org.apache.flink.runtime.executiongraph.ExecutionGraph; | ||
import org.apache.flink.runtime.jobgraph.IntermediateResultPartitionID; | ||
import org.apache.flink.runtime.topology.PipelinedRegion; | ||
|
||
/** | ||
* Pipelined region on execution level, i.e., {@link ExecutionGraph} level. | ||
*/ | ||
public interface SchedulingPipelinedRegion<V extends SchedulingExecutionVertex<V, R>, R extends SchedulingResultPartition<V, R>> extends PipelinedRegion<ExecutionVertexID, IntermediateResultPartitionID, V, R> { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
flink-runtime/src/main/java/org/apache/flink/runtime/topology/BaseTopology.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http:https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.flink.runtime.topology; | ||
|
||
/** | ||
* Base topology for all logical and execution topologies. | ||
* A topology consists of {@link Vertex} and {@link Result}. | ||
*/ | ||
public interface BaseTopology<VID extends VertexID, RID extends ResultID, | ||
V extends Vertex<VID, RID, V, R>, R extends Result<VID, RID, V, R>> { | ||
|
||
/** | ||
* Returns an iterable over all vertices, topologically sorted. | ||
* | ||
* @return topologically sorted iterable over all vertices | ||
*/ | ||
Iterable<V> getVertices(); | ||
|
||
/** | ||
* Returns whether the topology contains co-location constraints. | ||
* Co-location constraints are currently used for iterations. | ||
* | ||
* @return whether the topology contains co-location constraints | ||
*/ | ||
boolean containsCoLocationConstraints(); | ||
} |
57 changes: 57 additions & 0 deletions
57
flink-runtime/src/main/java/org/apache/flink/runtime/topology/PipelinedRegion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http:https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.apache.flink.runtime.topology; | ||
|
||
/** | ||
* A pipelined region is a set of vertices connected via pipelined data | ||
* exchanges. | ||
* | ||
* @param <VID> the type of the vertex ids | ||
* @param <RID> the type of the result ids | ||
* @param <V> the type of the vertices | ||
* @param <R> the type of the result | ||
*/ | ||
public interface PipelinedRegion<VID extends VertexID, RID extends ResultID, | ||
V extends Vertex<VID, RID, V, R>, R extends Result<VID, RID, V, R>> { | ||
|
||
/** | ||
* Returns vertices that are in this pipelined region. | ||
* | ||
* @return Iterable over all vertices in this pipelined region | ||
*/ | ||
Iterable<V> getVertices(); | ||
|
||
/** | ||
* Returns the vertex with the specified vertex id. | ||
* | ||
* @param vertexId the vertex id used to look up the vertex | ||
* @return the vertex with the specified id | ||
* @throws IllegalArgumentException if there is no vertex in this pipelined | ||
* region with the specified vertex id | ||
*/ | ||
V getVertex(VID vertexId); | ||
|
||
/** | ||
* Returns the results that this pipelined region consumes. | ||
* | ||
* @return Iterable over all consumed results | ||
*/ | ||
Iterable<R> getConsumedResults(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters