use of org.apache.ignite.internal.visor.baseline.VisorBaselineTaskResult in project ignite by apache.
the class CommandHandler method baselineVersion.
/**
* Set baseline by topology version.
*
* @param client Client.
* @param arg Argument from command line.
*/
private void baselineVersion(GridClient client, String arg) throws GridClientException {
try {
VisorBaselineTaskResult res = executeTask(client, VisorBaselineTask.class, arg(VERSION, arg));
baselinePrint0(res);
} catch (Throwable e) {
log("Failed to set baseline with specified topology version.");
throw e;
}
}
use of org.apache.ignite.internal.visor.baseline.VisorBaselineTaskResult in project ignite by apache.
the class CommandHandler method baselineRemove.
/**
* Remove nodes from baseline.
*
* @param client Client.
* @param consistentIds Consistent IDs.
* @throws Throwable If failed to remove nodes from baseline.
*/
private void baselineRemove(GridClient client, String consistentIds) throws Throwable {
try {
VisorBaselineTaskResult res = executeTask(client, VisorBaselineTask.class, arg(REMOVE, consistentIds));
baselinePrint0(res);
} catch (Throwable e) {
log("Failed to remove nodes from baseline.");
throw e;
}
}
use of org.apache.ignite.internal.visor.baseline.VisorBaselineTaskResult in project ignite by apache.
the class BaselineCommand method execute.
/**
* Change baseline.
*
* @param clientCfg Client configuration.
* @throws Exception If failed to execute baseline action.
*/
@Override
public Object execute(GridClientConfiguration clientCfg, Logger logger) throws Exception {
try (GridClient client = Command.startClient(clientCfg)) {
UUID coordinatorId = client.compute().nodes(node -> !node.isClient()).stream().min(Comparator.comparingLong(GridClientNode::order)).map(GridClientNode::nodeId).orElse(null);
VisorBaselineTaskResult res = executeTaskByNameOnNode(client, VisorBaselineTask.class.getName(), toVisorArguments(baselineArgs), coordinatorId, clientCfg);
baselinePrint0(res, logger);
} catch (Throwable e) {
logger.severe("Failed to execute baseline command='" + baselineArgs.getCmd().text() + "'");
logger.severe(CommandLogger.errorMessage(e));
throw e;
}
return null;
}
use of org.apache.ignite.internal.visor.baseline.VisorBaselineTaskResult in project ignite by apache.
the class CommandHandler method baselinePrint.
/**
* Print current baseline.
*
* @param client Client.
*/
private void baselinePrint(GridClient client) throws GridClientException {
VisorBaselineTaskResult res = executeTask(client, VisorBaselineTask.class, arg(COLLECT, ""));
baselinePrint0(res);
}
use of org.apache.ignite.internal.visor.baseline.VisorBaselineTaskResult in project ignite by apache.
the class CommandHandler method baselineSet.
/**
* Set baseline.
*
* @param client Client.
* @param consistentIds Consistent IDs.
* @throws Throwable If failed to set baseline.
*/
private void baselineSet(GridClient client, String consistentIds) throws Throwable {
try {
VisorBaselineTaskResult res = executeTask(client, VisorBaselineTask.class, arg(SET, consistentIds));
baselinePrint0(res);
} catch (Throwable e) {
log("Failed to set baseline.");
throw e;
}
}
Aggregations