/** * @param cancelled Is cancelled. */ private void checkIsDone(boolean cancelled) { if (remaining.isEmpty()) { sendRebalanceFinishedEvent(); if (log.isInfoEnabled()) log.info("Completed rebalance future: " + this); if (log.isDebugEnabled()) log.debug("Partitions have been scheduled to resend [reason=" + "Rebalance is done [grp=" + grp.cacheOrGroupName() + "]"); ctx.exchange().scheduleResendPartitions(); Collection<Integer> m = new HashSet<>(); for (Map.Entry<UUID, Collection<Integer>> e : missed.entrySet()) { if (e.getValue() != null && !e.getValue().isEmpty()) m.addAll(e.getValue()); } if (!m.isEmpty()) { U.log(log, ("Reassigning partitions that were missed: " + m)); onDone(false); //Finished but has missed partitions, will force dummy exchange ctx.exchange().forceReassign(exchId); return; } if (!cancelled && !grp.preloader().syncFuture().isDone()) ((GridFutureAdapter)grp.preloader().syncFuture()).onDone(); onDone(!cancelled); } }
/** * @param cancelled Is cancelled. */ private void checkIsDone(boolean cancelled) { if (remaining.isEmpty()) { sendRebalanceFinishedEvent(); if (log.isInfoEnabled()) log.info("Completed rebalance future: " + this); if (log.isDebugEnabled()) log.debug("Partitions have been scheduled to resend [reason=" + "Rebalance is done [grp=" + grp.cacheOrGroupName() + "]"); ctx.exchange().scheduleResendPartitions(); Collection<Integer> m = new HashSet<>(); for (Map.Entry<UUID, Collection<Integer>> e : missed.entrySet()) { if (e.getValue() != null && !e.getValue().isEmpty()) m.addAll(e.getValue()); } if (!m.isEmpty()) { U.log(log, ("Reassigning partitions that were missed: " + m)); onDone(false); //Finished but has missed partitions, will force dummy exchange ctx.exchange().forceReassign(exchId); return; } if (!cancelled && !grp.preloader().syncFuture().isDone()) ((GridFutureAdapter)grp.preloader().syncFuture()).onDone(); onDone(!cancelled); } }