forked from apache/flink
-
Notifications
You must be signed in to change notification settings - Fork 12
/
InternalExecutionGraphAccessor.java
125 lines (93 loc) · 4.53 KB
/
InternalExecutionGraphAccessor.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
* 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.executiongraph;
import org.apache.flink.api.common.JobID;
import org.apache.flink.runtime.blob.BlobWriter;
import org.apache.flink.runtime.blob.PermanentBlobKey;
import org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor;
import org.apache.flink.runtime.deployment.TaskDeploymentDescriptorFactory;
import org.apache.flink.runtime.execution.ExecutionState;
import org.apache.flink.runtime.executiongraph.failover.flip1.partitionrelease.PartitionGroupReleaseStrategy;
import org.apache.flink.runtime.io.network.partition.JobMasterPartitionTracker;
import org.apache.flink.runtime.jobgraph.IntermediateDataSetID;
import org.apache.flink.runtime.jobgraph.IntermediateResultPartitionID;
import org.apache.flink.runtime.jobgraph.JobVertexID;
import org.apache.flink.runtime.scheduler.strategy.ExecutionVertexID;
import org.apache.flink.runtime.shuffle.ShuffleDescriptor;
import org.apache.flink.runtime.shuffle.ShuffleMaster;
import org.apache.flink.types.Either;
import org.apache.flink.util.SerializedValue;
import javax.annotation.Nonnull;
import java.util.List;
import java.util.concurrent.Executor;
/**
* This interface encapsulates all methods needed by ExecutionJobVertex / ExecutionVertices /
* Execution from the DefaultExecutionGraph.
*/
public interface InternalExecutionGraphAccessor {
ClassLoader getUserClassLoader();
JobID getJobID();
BlobWriter getBlobWriter();
Either<SerializedValue<JobInformation>, PermanentBlobKey> getJobInformationOrBlobKey();
TaskDeploymentDescriptorFactory.PartitionLocationConstraint getPartitionLocationConstraint();
/**
* Returns the ExecutionContext associated with this ExecutionGraph.
*
* @return ExecutionContext associated with this ExecutionGraph
*/
Executor getFutureExecutor();
@Nonnull
ComponentMainThreadExecutor getJobMasterMainThreadExecutor();
ShuffleMaster<? extends ShuffleDescriptor> getShuffleMaster();
JobMasterPartitionTracker getPartitionTracker();
void registerExecution(Execution exec);
void deregisterExecution(Execution exec);
PartitionGroupReleaseStrategy getPartitionGroupReleaseStrategy();
void jobVertexFinished();
void jobVertexUnFinished();
ExecutionDeploymentListener getExecutionDeploymentListener();
/**
* Fails the execution graph globally.
*
* <p>This global failure is meant to be triggered in cases where the consistency of the
* execution graph' state cannot be guaranteed any more (for example when catching unexpected
* exceptions that indicate a bug or an unexpected call race), and where a full restart is the
* safe way to get consistency back.
*
* @param t The exception that caused the failure.
*/
void failGlobal(Throwable t);
void notifyExecutionChange(
Execution execution, ExecutionState previousState, ExecutionState newExecutionState);
void notifySchedulerNgAboutInternalTaskFailure(
ExecutionAttemptID attemptId,
Throwable t,
boolean cancelTask,
boolean releasePartitions);
EdgeManager getEdgeManager();
ExecutionVertex getExecutionVertexOrThrow(ExecutionVertexID id);
IntermediateResultPartition getResultPartitionOrThrow(final IntermediateResultPartitionID id);
void deleteBlobs(List<PermanentBlobKey> blobKeys);
ExecutionJobVertex getJobVertex(JobVertexID id);
boolean isDynamic();
ExecutionGraphID getExecutionGraphID();
/** Get the shuffle descriptors of the cluster partitions ordered by partition number. */
List<ShuffleDescriptor> getClusterPartitionShuffleDescriptors(
IntermediateDataSetID intermediateResultPartition);
MarkPartitionFinishedStrategy getMarkPartitionFinishedStrategy();
}