private void addTotalCountForMemberToResults(int limit) {
    int count = 0;
    for (Collection<Collection> results : resultsPerMember.values()) {
      for (Collection res : results) {
        if (res != null) {
          for (Object obj : res) {
            // Limit can be applied on count here as this is last
            // aggregation of bucket results.
            if (limit > -1 && count >= limit) {
              count = limit;
              break;
            }
            count += (Integer) obj;
          }
          res.clear();
        }
      }
    }

    cumulativeResults.clear();
    cumulativeResults.add(count);
  }
Adds all counts from all member buckets to cumulative results.
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionQueryEvaluator.java