public class CacheOperations { public void putOperations(Ignite ignite, String cache_name, int thread_num) { TimeRecord tr = new TimeRecord(); tr.reset(); int step = 20000; PutTask[] tasks = new PutTask[thread_num]; for (int i = 0; i < thread_num; i++) { tasks[i] = new PutTask(ignite, cache_name, step*(i-1), step*i); tasks[i].start(); } for (PutTask task: tasks){ try { task.join(); } catch (InterruptedException e) { e.printStackTrace(); } } long cost = tr.end(); System.out.println(Format.ops(thread_num*step, cost)); } private class PutTask extends Thread{ private IgniteCache cache; private int begin; private int end; public PutTask(Ignite ignite, String cache_name, int begin, int end){ this.cache = ignite.getOrCreateCache(cache_name); this.begin = begin; this.end = end; } @Override public void run() { for (int i = begin; i < end; i++){ cache.put(i, i); } } } }