-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature][scaleph-engine-flink-kubernetes] update flink savepoint ser…
…ivce (#585) * feature: update flink kubernetes job instance service * feature: add popconfirm for restart and savepoint * feature: add flink job savepoint table * feature: add flink job savepoint table * feature: add flink job savepoint service * feature: add flink job savepoint service * feature: update flink sql gateway open api and add flink sql select example
- Loading branch information
Showing
16 changed files
with
568 additions
and
79 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
70 changes: 70 additions & 0 deletions
70
...mmon/src/main/java/cn/sliew/scaleph/common/dict/flink/kubernetes/SavepointFormatType.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,70 @@ | ||
/* | ||
* 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 cn.sliew.scaleph.common.dict.flink.kubernetes; | ||
|
||
import cn.sliew.scaleph.common.dict.DictInstance; | ||
import com.baomidou.mybatisplus.annotation.EnumValue; | ||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
|
||
import java.util.Arrays; | ||
|
||
@JsonFormat(shape = JsonFormat.Shape.OBJECT) | ||
public enum SavepointFormatType implements DictInstance { | ||
|
||
CANONICAL("CANONICAL", "CANONICAL", "A canonical, common for all state backends format."), | ||
NATIVE("NATIVE", "NATIVE", "A format specific for the chosen state backend."), | ||
UNKNOWN("UNKNOWN", "UNKNOWN", "unknown"), | ||
; | ||
|
||
@JsonCreator | ||
public static SavepointFormatType of(String value) { | ||
return Arrays.stream(values()) | ||
.filter(instance -> instance.getValue().equals(value)) | ||
.findAny().orElseThrow(() -> new EnumConstantNotPresentException(SavepointFormatType.class, value)); | ||
} | ||
|
||
@EnumValue | ||
private String value; | ||
private String label; | ||
private String remark; | ||
|
||
SavepointFormatType(String value, String label, String remark) { | ||
this.value = value; | ||
this.label = label; | ||
this.remark = remark; | ||
} | ||
|
||
@Override | ||
public String getValue() { | ||
return value; | ||
} | ||
|
||
@Override | ||
public String getLabel() { | ||
return label; | ||
} | ||
|
||
@Override | ||
public String getRemark() { | ||
return remark; | ||
} | ||
|
||
|
||
} |
71 changes: 71 additions & 0 deletions
71
...mon/src/main/java/cn/sliew/scaleph/common/dict/flink/kubernetes/SavepointTriggerType.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,71 @@ | ||
/* | ||
* 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 cn.sliew.scaleph.common.dict.flink.kubernetes; | ||
|
||
import cn.sliew.scaleph.common.dict.DictInstance; | ||
import com.baomidou.mybatisplus.annotation.EnumValue; | ||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
|
||
import java.util.Arrays; | ||
|
||
@JsonFormat(shape = JsonFormat.Shape.OBJECT) | ||
public enum SavepointTriggerType implements DictInstance { | ||
|
||
MANUAL("MANUAL", "MANUAL", "Savepoint manually triggered by changing the savepointTriggerNonce."), | ||
PERIODIC("PERIODIC", "PERIODIC", "Savepoint periodically triggered by the operator."), | ||
UPGRADE("UPGRADE", "UPGRADE", "Savepoint triggered during stateful upgrade."), | ||
UNKNOWN("UNKNOWN", "UNKNOWN", "Savepoint trigger mechanism unknown, such as savepoint retrieved directly from Flink job."), | ||
; | ||
|
||
@JsonCreator | ||
public static SavepointTriggerType of(String value) { | ||
return Arrays.stream(values()) | ||
.filter(instance -> instance.getValue().equals(value)) | ||
.findAny().orElseThrow(() -> new EnumConstantNotPresentException(SavepointTriggerType.class, value)); | ||
} | ||
|
||
@EnumValue | ||
private String value; | ||
private String label; | ||
private String remark; | ||
|
||
SavepointTriggerType(String value, String label, String remark) { | ||
this.value = value; | ||
this.label = label; | ||
this.remark = remark; | ||
} | ||
|
||
@Override | ||
public String getValue() { | ||
return value; | ||
} | ||
|
||
@Override | ||
public String getLabel() { | ||
return label; | ||
} | ||
|
||
@Override | ||
public String getRemark() { | ||
return remark; | ||
} | ||
|
||
|
||
} |
51 changes: 51 additions & 0 deletions
51
...ain/java/cn/sliew/scaleph/dao/entity/master/ws/WsFlinkKubernetesJobInstanceSavepoint.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,51 @@ | ||
/* | ||
* 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 cn.sliew.scaleph.dao.entity.master.ws; | ||
|
||
import cn.sliew.scaleph.common.dict.flink.kubernetes.SavepointFormatType; | ||
import cn.sliew.scaleph.common.dict.flink.kubernetes.SavepointTriggerType; | ||
import cn.sliew.scaleph.dao.entity.BaseDO; | ||
import com.baomidou.mybatisplus.annotation.TableField; | ||
import com.baomidou.mybatisplus.annotation.TableName; | ||
import lombok.Data; | ||
|
||
/** | ||
* flink kubernetes job instance savepoint | ||
*/ | ||
@Data | ||
@TableName("ws_flink_kubernetes_job_instance_savepoint") | ||
public class WsFlinkKubernetesJobInstanceSavepoint extends BaseDO { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
@TableField("ws_flink_kubernetes_job_instance_id") | ||
private Long wsFlinkKubernetesJobInstanceId; | ||
|
||
@TableField("time_stamp") | ||
private Long timeStamp; | ||
|
||
@TableField("location") | ||
private String location; | ||
|
||
@TableField("trigger_type") | ||
private SavepointTriggerType triggerType; | ||
|
||
@TableField("format_type") | ||
private SavepointFormatType formatType; | ||
} |
Oops, something went wrong.