private Map<HardwareState, Long> calculateDataNodeInHardStateCount() {
    Map<HardwareState, Long> dataNodeInStateCount = new HashMap<HardwareState, Long>();
    for (HardwareState hardwareState : HardwareState.values()) {
      dataNodeInStateCount.put(hardwareState, new Long(0));
    }
    for (Datacenter datacenter : datacenters) {
      for (DataNode dataNode : datacenter.getDataNodes()) {
        dataNodeInStateCount.put(dataNode.getState(), dataNodeInStateCount.get(dataNode.getState()) + 1);
      }
    }
    return dataNodeInStateCount;
  }
An Ambry hardwareLayout consists of a set of {@link Datacenter}s.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/HardwareLayout.java