November 2018
Beginner to intermediate
260 pages
6h 12m
English
The Apache Ignite clustering API provides a class, ClusterGroup,
for the logical grouping of cluster nodes. Let's start with broadcasting a task to all the nodes of a cluster. Create a new class and add the following lines:
package com.packt;import org.apache.ignite.Ignite;import org.apache.ignite.IgniteCompute;import org.apache.ignite.Ignition;import org.apache.ignite.configuration.IgniteConfiguration;public class BroadcastAll { public static void main(String[] args) { IgniteConfiguration cfg = new IgniteConfiguration(); cfg.setPeerClassLoadingEnabled(true); try (Ignite ignite = Ignition.start(cfg)) { //Get a compute task IgniteCompute compute = ignite.compute(); //broadcast the computation to all nodes compute.broadcast(() -> ...Read now
Unlock full access