pub async fn cluster_remove_handler(
    request: Json<ClusterNodeRequest>,
    cluster_state: Extension<ClusterRef>,
) -> Result<String, ClusterError> {
    let req: ClusterNodeRequest = request.0;
    let cluster: ClusterRef = cluster_state.0;
    log::info!("Cluster remove node: {:?}", req);
    return match cluster.remove_node(req.clone().name) {
        Ok(_) => {
            log::error!("removed node {:?}", req.name);
            Ok(format!("removed node {:?}", req.name))
        }
        Err(_) => {
            log::error!("cannot remove node {:?}", req.name);
            Err(ClusterError::Remove)
        }
    };
}
// POST /v1/cluster/remove
// remove a node based on name in current databend-query cluster
// request: Node to be deleted
// cluster_state: the shared in memory state which store all nodes known to current node
// return: return Ok status code when delete success
POST /v1/cluster/remove
remove a node based on name in current databend-query cluster
request: Node to be deleted
cluster_state: the shared in memory state which store all nodes known to current node
return: return Ok status code when delete success
POST / v1 / cluster / remove remove a node based on name in current databend - query cluster request : Node to be deleted cluster_state : the shared in memory state which store all nodes known to current node return : return Ok status code when delete success
pub async fn cluster_remove_handler(
    request: Json<ClusterNodeRequest>,
    cluster_state: Extension<ClusterRef>,
) -> Result<String, ClusterError> {
    let req: ClusterNodeRequest = request.0;
    let cluster: ClusterRef = cluster_state.0;
    log::info!("Cluster remove node: {:?}", req);
    return match cluster.remove_node(req.clone().name) {
        Ok(_) => {
            log::error!("removed node {:?}", req.name);
            Ok(format!("removed node {:?}", req.name))
        }
        Err(_) => {
            log::error!("cannot remove node {:?}", req.name);
            Err(ClusterError::Remove)
        }
    };
}
pub async fn cluster_remove_handler ( request : Json < ClusterNodeRequest > , cluster_state : Extension < ClusterRef > , ) -> Result < String , ClusterError > { let req : ClusterNodeRequest = request . 0 ; let cluster : ClusterRef = cluster_state . 0 ; log :: info ! ( " " req ) ; return match cluster . remove_node ( req . clone ( ) . name ) { Ok ( _ ) => { log :: error ! ( " " req name ) ; Ok ( format ! ( " " req name ) ) } Err ( _ ) => { log :: error ! ( " " req name ) ; Err ( ClusterError :: Remove ) } } ; }
POST /v1/cluster/remove
remove a node based on name in current databend-query cluster
request: Node to be deleted
cluster_state: the shared in memory state which store all nodes known to current node
return: return Ok status code when delete success
POST / v1 / cluster / remove remove a node based on name in current databend - query cluster request : Node to be deleted cluster_state : the shared in memory state which store all nodes known to current node return : return Ok status code when delete success
request
Json<ClusterNodeRequest>
cluster_state
Extension<ClusterRef>
request
Json<ClusterNodeRequest>
cluster_state
Extension<ClusterRef>