You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Zheng Wang (Jira)" <ji...@apache.org> on 2020/08/19 12:06:00 UTC

[jira] [Updated] (HBASE-24908) Correct the description of hbase.offpeak.end.hour

     [ https://issues.apache.org/jira/browse/HBASE-24908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zheng Wang updated HBASE-24908:
-------------------------------
    Description: 
The inclusive in description should be exclusive, it will mislead users.

OffPeakHours.java
{code:java}
private static class OffPeakHoursImpl extends OffPeakHours {
  final int startHour;
  final int endHour;

  /**
   * @param startHour inclusive
   * @param endHour exclusive
   */
  OffPeakHoursImpl(int startHour, int endHour) {
    this.startHour = startHour;
    this.endHour = endHour;
  }

  @Override
  public boolean isOffPeakHour() {
    return isOffPeakHour(CurrentHourProvider.getCurrentHour());
  }

  @Override
  public boolean isOffPeakHour(int targetHour) {
    if (startHour <= endHour) {
      return startHour <= targetHour && targetHour < endHour;
    }
    return targetHour < endHour || startHour <= targetHour;
  }
}
{code}
 

  was:
The inclusive in description should be exclusive, it will mislead users.

 
{code:java}
    @Override
    public boolean isOffPeakHour(int targetHour) {
      if (startHour <= endHour) {
        return startHour <= targetHour && targetHour < endHour;
      }
      return targetHour < endHour || startHour <= targetHour;
    }
{code}
 


> Correct the description of hbase.offpeak.end.hour
> -------------------------------------------------
>
>                 Key: HBASE-24908
>                 URL: https://issues.apache.org/jira/browse/HBASE-24908
>             Project: HBase
>          Issue Type: Improvement
>          Components: documentation
>            Reporter: Zheng Wang
>            Assignee: Zheng Wang
>            Priority: Major
>
> The inclusive in description should be exclusive, it will mislead users.
> OffPeakHours.java
> {code:java}
> private static class OffPeakHoursImpl extends OffPeakHours {
>   final int startHour;
>   final int endHour;
>   /**
>    * @param startHour inclusive
>    * @param endHour exclusive
>    */
>   OffPeakHoursImpl(int startHour, int endHour) {
>     this.startHour = startHour;
>     this.endHour = endHour;
>   }
>   @Override
>   public boolean isOffPeakHour() {
>     return isOffPeakHour(CurrentHourProvider.getCurrentHour());
>   }
>   @Override
>   public boolean isOffPeakHour(int targetHour) {
>     if (startHour <= endHour) {
>       return startHour <= targetHour && targetHour < endHour;
>     }
>     return targetHour < endHour || startHour <= targetHour;
>   }
> }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)