-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the evaluation process of the final status of flink k8s tasks to…
… the flink-k8s-v2 module for better readability. #2881
- Loading branch information
Showing
9 changed files
with
160 additions
and
94 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
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
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
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
55 changes: 55 additions & 0 deletions
55
...etes-engine/src/main/scala/org/apache/streampark/flink/kubernetes/v2/model/JobState.scala
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,55 @@ | ||
/* | ||
* 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://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.streampark.flink.kubernetes.v2.model | ||
|
||
import org.apache.streampark.flink.kubernetes.v2.model.JobState.JobState | ||
|
||
/** | ||
* Original Flink Job State. | ||
* This enum is essentially equivalent to the meaning in the Flink REST API. | ||
* see: [[org.apache.flink.kubernetes.operator.api.status.JobStatus]] | ||
*/ | ||
object JobState extends Enumeration { | ||
|
||
type JobState = Value | ||
val INITIALIZING, CREATED, RUNNING, FAILING, FAILED, CANCELLING, CANCELED, FINISHED, RESTARTING, SUSPENDED, | ||
RECONCILING = Value | ||
val UNKNOWN = Value | ||
|
||
def valueOf(raw: String): JobState = values.find(_.toString == raw).getOrElse(UNKNOWN) | ||
val maybeDeploying = Set(INITIALIZING, CREATED, RESTARTING, RECONCILING) | ||
} | ||
|
||
/** | ||
* Evaluated Job State. | ||
* This state is the result of a combination of Flink CR and REST API evaluations, | ||
* It can be converted directly to StreamPark [[org.apache.streampark.console.core.enums.FlinkAppState]] | ||
*/ | ||
object EvalJobState extends Enumeration { | ||
|
||
type EvalJobState = Value | ||
|
||
val INITIALIZING, CREATED, RUNNING, FAILING, FAILED, CANCELLING, CANCELED, FINISHED, RESTARTING, SUSPENDED, | ||
RECONCILING = Value | ||
|
||
// copy from [[org.apache.streampark.console.core.enums.FlinkAppState]] | ||
val LOST, TERMINATED, OTHER = Value | ||
|
||
def of(state: JobState): EvalJobState = values.find(e => e.toString == state.toString).getOrElse(OTHER) | ||
|
||
} |
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
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
Oops, something went wrong.