forked from apache/paimon-webui
-
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.
[improvement] Remove unnecessary changes.
- Loading branch information
1 parent
d89be6b
commit 13be648
Showing
17 changed files
with
333 additions
and
107 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
...ommon/src/main/java/org/apache/paimon/web/engine/flink/common/status/HeartbeatStatus.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,37 @@ | ||
/* | ||
* 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.paimon.web.engine.flink.common.status; | ||
|
||
/** This enum represents the status of a cluster heartbeat. */ | ||
public enum HeartbeatStatus { | ||
/** * The cluster is active. */ | ||
ACTIVE, | ||
/** Unable to connect to the target machine, usually due to network anomalies. */ | ||
UNREACHABLE, | ||
/** | ||
* The cluster is in an unknown state, usually due to a cluster don't result heartbeat | ||
* information, but its network is normal. | ||
*/ | ||
UNKNOWN, | ||
/** | ||
* The cluster is dead, usually due to a cluster don't obtain heartbeat information for a long | ||
* time. | ||
*/ | ||
DEAD; | ||
} |
47 changes: 47 additions & 0 deletions
47
.../src/main/java/org/apache/paimon/web/engine/flink/sql/gateway/client/HeartbeatAction.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,47 @@ | ||
/* | ||
* 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.paimon.web.engine.flink.sql.gateway.client; | ||
|
||
import org.apache.paimon.web.engine.flink.common.status.HeartbeatStatus; | ||
import org.apache.paimon.web.engine.flink.sql.gateway.model.HeartbeatEntity; | ||
|
||
/** Using to execute cluster heartbeat action. */ | ||
public interface HeartbeatAction { | ||
|
||
/** | ||
* Execute cluster action to obtain cluster status. | ||
* | ||
* @return cluster heartbeat entity. | ||
*/ | ||
HeartbeatEntity checkClusterHeartbeat(); | ||
|
||
/** | ||
* Build a heartbeat entity representing an error based on the cluster status. This method is | ||
* used to generate a heartbeat object when the cluster status is abnormal, recording the | ||
* current time and the error status of the cluster. | ||
* | ||
* @param status The current status of the cluster, used to set the status field of the | ||
* heartbeat entity. | ||
* @return Returns a completed heartbeat entity, including the current timestamp and status | ||
* information. | ||
*/ | ||
default HeartbeatEntity buildResulHeartbeatEntity(HeartbeatStatus status) { | ||
return HeartbeatEntity.builder().status(status.name()).build(); | ||
} | ||
} |
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
31 changes: 31 additions & 0 deletions
31
...y/src/main/java/org/apache/paimon/web/engine/flink/sql/gateway/model/HeartbeatEntity.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://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.paimon.web.engine.flink.sql.gateway.model; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
/** This is a heartbeat entity of the cluster. */ | ||
@Builder | ||
@Getter | ||
public class HeartbeatEntity { | ||
private String status; | ||
private Long lastHeartbeat; | ||
private String clusterVersion; | ||
} |
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
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.