code: private List<PoolMetadata> getPoolMetadataList() {
      Map<String, PoolMetadata> poolNameMetadataMap =
          new HashMap<String, PoolMetadata>();
      for (Map.Entry<ResourceType, SchedulerForType> schedulerEntry :
          schedulersForTypes.entrySet()) {
        for (Map.Entry<PoolInfo, PoolInfoMetrics> poolEntry :
            schedulerEntry.getValue().getPoolInfoMetrics().entrySet()) {
          ResourceMetadata resourceMetadata =
              poolEntry.getValue().getResourceMetadata();
          // Ignore any invalid pool metrics
          if (resourceMetadata == null) {
            continue;
          }
          String stringifiedPoolInfo =
              PoolInfo.createStringFromPoolInfo(poolEntry.getKey());
          PoolMetadata poolMetadata =
              poolNameMetadataMap.get(stringifiedPoolInfo);
          if (poolMetadata == null) {
            poolMetadata = new PoolMetadata(stringifiedPoolInfo);
            poolNameMetadataMap.put(stringifiedPoolInfo, poolMetadata);
          }
          poolMetadata.addResourceMetadata(schedulerEntry.getKey().toString(),
                                           resourceMetadata);
        }
      }
      return new ArrayList<PoolMetadata>(poolNameMetadataMap.values());
    }
docs: Get a snapshot of the {@link PoolMetadata} objects for all the schedulers
  for each resource type.  This is used for gathering metrics.
  
  @return List of snapshots for each pool and its resources