...
draw.io Diagram |
---|
border | true |
---|
| |
---|
diagramName | Command Registry |
---|
simpleViewer | false |
---|
width | |
---|
links | auto |
---|
tbstyle | top |
---|
lbox | true |
---|
diagramWidth | 1433 |
---|
revision | 1 |
---|
|
Command
Management commands are always wrapped with the ProxyManagementTask. The management command may be executed on a single cluster node only or broadcasted to all nodes with reducing the execution results.
Code Block |
---|
language | java |
---|
title | IgniteCommand |
---|
linenumbers | true |
---|
collapse | true |
---|
|
/** */
public interface IgniteCommand<T> extends IgniteCallable<T>, IgniteReducer<T, T> {
/** {@inheritDoc} */
@Override public default boolean collect(@Nullable T t) {
return true;
}
/** {@inheritDoc} */
@Override public default T reduce() {
return null;
}
} |
Code Block |
---|
language | java |
---|
title | BaselineAddCommand.class |
---|
linenumbers | true |
---|
collapse | true |
---|
|
/** */
@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();
}
} |
Roadmap
Phase-1
Phase-2
Risks and Assumptions
...