@Override
        public Optional<GroupStatus> takeNextGroup(Set<Integer> rejectedGroups) {
            GroupStatus bestCandidate = null;

            int groupId = needle;
            for (int i = 0; i < scoreboard.size(); i++) {
                GroupStatus candidate = scoreboard.get(groupId);
                if (rejectedGroups == null || !rejectedGroups.contains(candidate.groupId())) {
                    GroupStatus better = betterGroup(bestCandidate, candidate);
                    if (better == candidate) {
                        bestCandidate = candidate;
                    }
                }
                groupId = nextScoreboardIndex(groupId);
            }
            needle = nextScoreboardIndex(bestCandidate.groupId());
            return Optional.of(bestCandidate);
        }
Release an allocation given by {@link #takeGroup}. The release must be done exactly once for each allocation.

@param group previously allocated group
@param success was the query successful
@param searchTime query execution time, used for adaptive load balancing
container-search/src/main/java/com/yahoo/search/dispatch/LoadBalancer.java