The compute grid's run() API works with IgniteRunnable. The IgniteRunnable extends Java's Runnable interface; the run() method is executed in the remote cluster. We are going to create a runnable and examine the run behavior. The following are the steps:
- Create a class, AdderRunnable, to add two numbers remotely. Implement the IgniteRunnable interface and create a constructor to pass two integers. In the run method, add the numbers and print it in console:
class AdderRunnable implements IgniteRunnable { private static final long serialVersionUID = 1L; private final int first; private final int second; public AdderRunnable(int first, int second) { super(); this.first = first; this.second = second; } @Override ...