use of io.crate.cluster.decommission.DecommissionNodeRequest in project crate by crate.
the class DecommissionNodePlan method executeOrFail.
@Override
public void executeOrFail(DependencyCarrier dependencies, PlannerContext plannerContext, RowConsumer consumer, Row params, SubQueryResults subQueryResults) {
var boundedNodeIdOrName = boundNodeIdOrName(analyzedDecommissionNode, plannerContext.transactionContext(), plannerContext.nodeContext(), params, subQueryResults);
String targetNodeId = NodeSelection.resolveNodeId(dependencies.clusterService().state().nodes(), boundedNodeIdOrName);
dependencies.transportActionProvider().transportDecommissionNodeAction().execute(targetNodeId, new DecommissionNodeRequest(), new OneRowActionListener<>(consumer, r -> r.isAcknowledged() ? new Row1(1L) : new Row1(0L)));
}
Aggregations