code: public float getCapacity(String queue) {
      //Check done in order to return default capacity which can be negative
      //In case of both capacity and default capacity not configured.
      //Last check is if the configuration is specified and is marked as
      //negative we throw exception
      String raw = rmConf.getRaw(toFullPropertyName(queue, CAPACITY_PROPERTY));
      if(raw == null) {
        return -1;
      }
      float result = rmConf.getFloat(
        toFullPropertyName(queue, CAPACITY_PROPERTY), -1);
      if (result < 0.0 || result > 100.0) {
        throw new IllegalArgumentException(
          "Illegal capacity for queue " + queue +
                                           " of " + result);
      }
      return result;
    }
docs: Get the percentage of the cluster for the specified queue.
  
  This method defaults to configured default Capacity if
  no value is specified in the configuration for this queue.
  If the configured capacity is negative value or greater than 100 an
  {@link IllegalArgumentException} is thrown.
  
  If default capacity is not configured for a queue, then
  system allocates capacity based on what is free at the time of
  capacity scheduler start
  
  
  @param queue name of the queue
  @return percent of the cluster for the queue.