@Override
  public void validate(ClusterTopology topology) throws InvalidTopologyException {
    Stack stack = topology.getBlueprint().getStack();
    validateConfig(topology.getConfiguration().getFullProperties(), stack);
    for (HostGroupInfo hostGroup : topology.getHostGroupInfo().values()) {
      validateConfig(hostGroup.getConfiguration().getFullProperties(), stack);
    }
  }
I validate the unit of properties by checking if it matches to the stack defined unit.
Properties with different unit than the stack defined unit are rejected.
ambari-server/src/main/java/org/apache/ambari/server/topology/validators/UnitValidator.java