/** 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();
}
}
Purpose
close: https://github.com/apache/paimon-webui/issues/317
Tests
ClusterControllerTest#testGetHeartbeatActionFactory
ClusterControllerTest#testCheckClusterHeartbeatStatus
ClusterControllerTest#testCheckClusterHeartbeatOfFlinkSession
ClusterControllerTest#testCheckClusterHeartbeatOfFlinkSqlGateway
API and Format