public void cleanRebalancingState(RebalancePartitionsInfo stealInfo) { synchronized (lock) { RebalancerState rebalancerState = getRebalancerState(); if (!rebalancerState.remove(stealInfo)) throw new IllegalArgumentException("Couldn't find " + stealInfo + " in " + rebalancerState); if (rebalancerState.isEmpty()) { logger.debug("stealInfoList empty, cleaning all rebalancing state"); cleanAllRebalancingState(); } else { put(REBALANCING_STEAL_INFO, rebalancerState); initCache(REBALANCING_STEAL_INFO); } } }