THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
/** */ @Command(name = "add", commandDescription = "Add nodes to baseline topology.") public class BaselineAddCommand implements IgniteCallable<String> { /** Auto-injected Ignite instance. */ @IgniteInstanceResource private IgniteEx ignite; /** Parameter will be injected on command instantiation. Default comma separation. */ @Parameter(names = {"--nodes", "-n"}, description = "List of baseline nodes to add.") private List<String> consistentIds; /** {@inheritDoc} */ @Override public String call() throws Exception { Collection<BaselineNode> baseline = ignite.cluster().currentBaselineTopology(); Collection<ClusterNode> srvs = ignite.cluster().forServers().nodes(); for (String consistentId : consistentIds) { ClusterNode node = F.find(srvs, null, new IgnitePredicate<ClusterNode>() { @Override public boolean apply(ClusterNode node) { return node.consistentId().toString().equals(consistentId); } }); if (node == null) throw new IllegalArgumentException("Node not found for consistent ID: " + consistentId); baseline.add(node); } ignite.cluster().setBaselineTopology(baseline); return consistentIds.toString(); } } |
The following changes must be introduced to allow new command creation and migration processes:
To be done.
// Describe project risks, such as API or binary compatibility issues, major protocol changes, etc.
...