/** * Gets all the data and removes it from the cache. * * @return All data for all vertices for all partitions */ public PairList<WorkerInfo, PairList<Integer, D>> removeAllData() { PairList<WorkerInfo, PairList<Integer, D>> allData = new PairList<WorkerInfo, PairList<Integer, D>>(); allData.initialize(dataSizes.length); for (WorkerInfo workerInfo : workerPartitions.keySet()) { PairList<Integer, D> workerData = removeWorkerData(workerInfo); if (!workerData.isEmpty()) { allData.add(workerInfo, workerData); } dataSizes[workerInfo.getTaskId()] = 0; } return allData; }