@@ -20,93 +20,73 @@ package org.apache.spark.sql.pipelines.graph
20
20
import org .apache .spark .sql .catalyst .TableIdentifier
21
21
import org .apache .spark .sql .pipelines .common .RunState
22
22
23
- sealed trait UpdateTerminationReason {
23
+ sealed trait RunTerminationReason {
24
24
25
- /** Terminal state for the given update . */
25
+ /** Terminal state for the given run . */
26
26
def terminalState : RunState
27
27
28
28
/**
29
- * User visible message associated with update termination. This will also be set as the message
30
- * in the associated terminal update progress log.
29
+ * User visible message associated with run termination. This will also be set as the message
30
+ * in the associated terminal run progress log.
31
31
*/
32
32
def message : String
33
33
34
34
/**
35
- * Exception associated with the given update termination. This exception will be
36
- * included in the error details in the associated terminal update progress event.
35
+ * Exception associated with the given run termination. This exception will be
36
+ * included in the error details in the associated terminal run progress event.
37
37
*/
38
38
def cause : Option [Throwable ]
39
-
40
- /**
41
- * Whether this termination reason should override the partial execution failure thrown during
42
- * flow execution.
43
- */
44
- def overridesPartialExecutionFailure : Boolean = false
45
39
}
46
40
47
41
/**
48
- * Helper exception class that indicates that an update has to be terminated and
42
+ * Helper exception class that indicates that a run has to be terminated and
49
43
* tracks the associated termination reason.
50
44
*/
51
- case class UpdateTerminationException (reason : UpdateTerminationReason ) extends Exception
45
+ case class RunTerminationException (reason : RunTerminationReason ) extends Exception
52
46
53
47
// ===============================================================
54
- // ============ Graceful update termination states ===============
48
+ // ============ Graceful run termination states === ===============
55
49
// ===============================================================
56
50
57
- /** Indicates that a triggered update has successfully completed execution. */
58
- case class UpdateCompletion () extends UpdateTerminationReason {
51
+ /** Indicates that a triggered run has successfully completed execution. */
52
+ case class RunCompletion () extends RunTerminationReason {
59
53
override def terminalState : RunState = RunState .COMPLETED
60
- override def message : String = s " Update is $terminalState. "
54
+ override def message : String = s " Run is $terminalState. "
61
55
override def cause : Option [Throwable ] = None
62
56
}
63
57
64
- /**
65
- * Indicates that the update is being terminated since the schema for a given flow
66
- * changed during execution.
67
- */
68
- case class UpdateSchemaChange (flowName : String , override val cause : Option [Throwable ])
69
- extends UpdateTerminationReason {
70
- override def terminalState : RunState = RunState .CANCELED
71
- override def message : String =
72
- s " Update has been cancelled due to a schema change in $flowName, " +
73
- s " and will be restarted. "
74
-
75
- override def overridesPartialExecutionFailure : Boolean = true
76
- }
77
-
78
58
// ===============================================================
79
- // ======================= Update failures =======================
59
+ // ======================= Run failures === =======================
80
60
// ===============================================================
81
61
82
- /** Indicates that an update entered the failed state.. */
83
- abstract sealed class UpdateFailure extends UpdateTerminationReason {
62
+ /** Indicates that an run entered the failed state.. */
63
+ abstract sealed class RunFailure extends RunTerminationReason {
84
64
85
65
/** Whether or not this failure is considered fatal / irrecoverable. */
86
66
def isFatal : Boolean
87
67
88
68
override def terminalState : RunState = RunState .FAILED
89
69
}
90
70
91
- /** Indicates that update has failed due to a query execution failure. */
71
+ /** Indicates that run has failed due to a query execution failure. */
92
72
case class QueryExecutionFailure (
93
73
flowName : String ,
94
74
maxRetries : Int ,
95
75
override val cause : Option [Throwable ])
96
- extends UpdateFailure {
76
+ extends RunFailure {
97
77
override def isFatal : Boolean = false
98
78
99
79
override def message : String =
100
80
if (maxRetries == 0 ) {
101
- s " Update is $terminalState since flow ' $flowName' has failed. "
81
+ s " Run is $terminalState since flow ' $flowName' has failed. "
102
82
} else {
103
- s " Update is $terminalState since flow ' $flowName' has failed more " +
83
+ s " Run is $terminalState since flow ' $flowName' has failed more " +
104
84
s " than $maxRetries times. "
105
85
}
106
86
}
107
87
108
88
/** Abstract class used to identify failures related to failures stopping an operation/timeouts. */
109
- abstract class FailureStoppingOperation extends UpdateFailure {
89
+ abstract class FailureStoppingOperation extends RunFailure {
110
90
111
91
/** Name of the operation that failed to stop. */
112
92
def operation : String
@@ -120,22 +100,22 @@ case class FailureStoppingFlow(flowIdentifiers: Seq[TableIdentifier])
120
100
override def message : String = {
121
101
if (flowIdentifiers.nonEmpty) {
122
102
val flowNamesToPrint = flowIdentifiers.map(_.toString).sorted.take(5 ).mkString(" , " )
123
- s " Update is $terminalState since following flows have failed to stop: " +
103
+ s " Run is $terminalState since following flows have failed to stop: " +
124
104
s " $flowNamesToPrint. "
125
105
} else {
126
- s " Update is $terminalState since stopping flow execution has failed. "
106
+ s " Run is $terminalState since stopping flow execution has failed. "
127
107
}
128
108
}
129
109
override def cause : Option [Throwable ] = None
130
110
}
131
111
132
112
/**
133
- * Update could not be associated with a proper root cause.
113
+ * Run could not be associated with a proper root cause.
134
114
* This is not expected and likely indicates a bug.
135
115
*/
136
- case class UnexpectedUpdateFailure () extends UpdateFailure {
116
+ case class UnexpectedRunFailure () extends RunFailure {
137
117
override def isFatal : Boolean = false
138
118
override def message : String =
139
- s " Update $terminalState unexpectedly. "
119
+ s " Run $terminalState unexpectedly. "
140
120
override def cause : Option [Throwable ] = None
141
121
}
0 commit comments