November 2018
Beginner to intermediate
260 pages
6h 12m
English
To work with the local node, you need to get the local ClusterGroup:
public class LocalNodes { public static void main(String[] args) { IgniteConfiguration cfg = new IgniteConfiguration(); cfg.setPeerClassLoadingEnabled(true); try (Ignite ignite = Ignition.start(cfg)) { IgniteCluster cluster = ignite.cluster(); //Get local server group ClusterGroup forLocal = cluster.forLocal(); //Get a compute task for local servers IgniteCompute compute = ignite.compute(forLocal); //broadcast the computation to local nodes compute.broadcast(() -> { System.out.println("********\r\nLocal Only\r\n*********"); }); } }}
It prints the message to the local program console only:
Read now
Unlock full access