code: private void collectWorkerInfo(List<WorkerInfo> workerInfoList) {
      initVariables();
      for (WorkerInfo workerInfo : workerInfoList) {
        long usedBytes = workerInfo.getUsedBytes();
        long capacityBytes = workerInfo.getCapacityBytes();
        mSumCapacityBytes += capacityBytes;
        mSumUsedBytes += usedBytes;
  
        String workerName = workerInfo.getAddress().getHost();
  
        Map<String, Long> totalBytesOnTiers = workerInfo.getCapacityBytesOnTiers();
        for (Map.Entry<String, Long> totalBytesTier : totalBytesOnTiers.entrySet()) {
          String tier = totalBytesTier.getKey();
          long value = totalBytesTier.getValue();
          mSumCapacityBytesOnTierMap.put(tier,
              value + mSumCapacityBytesOnTierMap.getOrDefault(tier, 0L));
  
          Map<String, String> map = mCapacityTierInfoMap.getOrDefault(tier, new HashMap<>());
          map.put(workerName, FormatUtils.getSizeFromBytes(value));
          mCapacityTierInfoMap.put(tier, map);
        }
  
        Map<String, Long> usedBytesOnTiers = workerInfo.getUsedBytesOnTiers();
        for (Map.Entry<String, Long> usedBytesTier: usedBytesOnTiers.entrySet()) {
          String tier = usedBytesTier.getKey();
          long value = usedBytesTier.getValue();
          mSumUsedBytesOnTierMap.put(tier,
              value + mSumUsedBytesOnTierMap.getOrDefault(tier, 0L));
  
          Map<String, String> map = mUsedTierInfoMap.getOrDefault(tier, new HashMap<>());
          map.put(workerName, FormatUtils.getSizeFromBytes(value));
          mUsedTierInfoMap.put(tier, map);
        }
      }
    }
docs: Collects worker capacity information.
  
  @param workerInfoList the worker info list to collect info from