You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2020/07/29 17:42:15 UTC

[GitHub] [hive] HunterL opened a new pull request #1334: HIVE-21611: Date.getTime() can be changed to System.currentTimeMillis()

HunterL opened a new pull request #1334:
URL: https://github.com/apache/hive/pull/1334


   Date.getTime() is a less performant thin wrapper of System.currentTimeMillis()


----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] github-actions[bot] closed pull request #1334: HIVE-21611: Date.getTime() can be changed to System.currentTimeMillis()

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #1334:
URL: https://github.com/apache/hive/pull/1334


   


----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] HunterL commented on a change in pull request #1334: HIVE-21611: Date.getTime() can be changed to System.currentTimeMillis()

Posted by GitBox <gi...@apache.org>.
HunterL commented on a change in pull request #1334:
URL: https://github.com/apache/hive/pull/1334#discussion_r463745530



##########
File path: hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/ZooKeeperCleanup.java
##########
@@ -149,7 +147,7 @@ public boolean checkAndDelete(String node, CuratorFramework zk) {
       JobStateTracker tracker = new JobStateTracker(node, zk, true,
         appConf.get(TempletonStorage.STORAGE_ROOT +
           ZooKeeperStorage.TRACKINGDIR));
-      long now = new Date().getTime();
+      long now = System.currentTimeMillis();

Review comment:
       Same story as the call in `HDFSCleanup`, this is used for comparison




----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] belugabehr commented on a change in pull request #1334: HIVE-21611: Date.getTime() can be changed to System.currentTimeMillis()

Posted by GitBox <gi...@apache.org>.
belugabehr commented on a change in pull request #1334:
URL: https://github.com/apache/hive/pull/1334#discussion_r463610831



##########
File path: hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/HDFSCleanup.java
##########
@@ -113,8 +112,7 @@ public void run() {
         }
 
         long sleepMillis = (long) (Math.random() * interval);
-        LOG.info("Next execution: " + new Date(new Date().getTime()
-                             + sleepMillis));
+        LOG.info("Next execution: " + (System.currentTimeMillis() + sleepMillis));

Review comment:
       This changes the behavior because it previously would print a DATE, now it's just printing a number.




----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] HunterL commented on a change in pull request #1334: HIVE-21611: Date.getTime() can be changed to System.currentTimeMillis()

Posted by GitBox <gi...@apache.org>.
HunterL commented on a change in pull request #1334:
URL: https://github.com/apache/hive/pull/1334#discussion_r463745229



##########
File path: hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/HDFSCleanup.java
##########
@@ -134,7 +132,7 @@ public void run() {
    * @throws IOException
    */
   private void checkFiles(FileSystem fs) throws IOException {
-    long now = new Date().getTime();
+    long now = System.currentTimeMillis();

Review comment:
       This one uses the current time to compare to a files last modified time, so `System.nanoTime();` doesn't work here




----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] github-actions[bot] commented on pull request #1334: HIVE-21611: Date.getTime() can be changed to System.currentTimeMillis()

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #1334:
URL: https://github.com/apache/hive/pull/1334#issuecomment-701722885


   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
   Feel free to reach out on the dev@hive.apache.org list if the patch is in need of reviews.


----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] github-actions[bot] closed pull request #1334: HIVE-21611: Date.getTime() can be changed to System.currentTimeMillis()

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #1334:
URL: https://github.com/apache/hive/pull/1334


   


----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org