public static OffPeakHours getInstance(int startHour, int endHour) {
    if (startHour == -1 && endHour == -1) {
      return DISABLED;
    }

    if (!isValidHour(startHour) || !isValidHour(endHour)) {
      if (LOG.isWarnEnabled()) {
        LOG.warn("Ignoring invalid start/end hour for peak hour : start = " + startHour + " end = "
          + endHour + ". Valid numbers are [0-23]");
      }
      return DISABLED;
    }

    if (startHour == endHour) {
      return DISABLED;
    }

    return new OffPeakHoursImpl(startHour, endHour);
  }
@param startHour inclusive
@param endHour   exclusive
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/OffPeakHours.java