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 06:54:00 UTC

[jira] [Comment Edited] (HBASE-24898) Use EnvironmentEdge.currentTime() instead of System.currentTimeMillis() in CurrentHourProvider

    [ https://issues.apache.org/jira/browse/HBASE-24898?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17180306#comment-17180306 ] 

Zheng Wang edited comment on HBASE-24898 at 8/19/20, 6:53 AM:
--------------------------------------------------------------

 
{code:java}
private static Tick nextTick() {
  Calendar calendar = new GregorianCalendar();
  int currentHour = calendar.get(Calendar.HOUR_OF_DAY);
  moveToNextHour(calendar);
  return new Tick(currentHour, calendar.getTimeInMillis());
}
{code}
The moveToNextHour in fact only impact the expirationTimeInMillis.


was (Author: filtertip):
{quote}private static Tick nextTick() {
 Calendar calendar = new GregorianCalendar();
 int currentHour = calendar.get(Calendar.HOUR_OF_DAY);
 moveToNextHour(calendar);
 return new Tick(currentHour, calendar.getTimeInMillis());
}
{quote}
The moveToNextHour in fact only impact the expirationTimeInMillis.

> Use EnvironmentEdge.currentTime() instead of System.currentTimeMillis() in CurrentHourProvider
> ----------------------------------------------------------------------------------------------
>
>                 Key: HBASE-24898
>                 URL: https://issues.apache.org/jira/browse/HBASE-24898
>             Project: HBase
>          Issue Type: Bug
>          Components: tooling
>            Reporter: Zheng Wang
>            Assignee: Zheng Wang
>            Priority: Major
>
> In order to control the return value of getCurrentHour used by unit test.



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