You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2020/08/20 08:46:49 UTC

[GitHub] [hbase] bsglz commented on a change in pull request #2272: HBASE-24898 Use EnvironmentEdge.currentTime() instead of System.currentTimeMillis() in CurrentHourProvider

bsglz commented on a change in pull request #2272:
URL: https://github.com/apache/hbase/pull/2272#discussion_r473775819



##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CurrentHourProvider.java
##########
@@ -54,11 +56,15 @@ private static void moveToNextHour(Calendar calendar) {
 
   public static int getCurrentHour() {
     Tick tick = CurrentHourProvider.tick;
-    if(System.currentTimeMillis() < tick.expirationTimeInMillis) {
+    if (EnvironmentEdgeManager.currentTime() < tick.expirationTimeInMillis) {
       return tick.currentHour;
     }
 
     CurrentHourProvider.tick = tick = nextTick();
     return tick.currentHour;
   }
+
+  protected static void forceUpdateTickForTest() {

Review comment:
       Do you mean like this:
   
   >     if (EnvironmentEdgeManager.currentTime() <= 23) {
   >       return (int)EnvironmentEdgeManager.currentTime();
   >     }




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org