[ 
https://issues.apache.org/jira/browse/HIVE-23793?focusedWorklogId=458656&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-458656
 ]

ASF GitHub Bot logged work on HIVE-23793:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/Jul/20 14:20
            Start Date: 14/Jul/20 14:20
    Worklog Time Spent: 10m 
      Work Description: belugabehr commented on a change in pull request #1197:
URL: https://github.com/apache/hive/pull/1197#discussion_r454391934



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/QueryInfo.java
##########
@@ -17,48 +17,58 @@
  */
 package org.apache.hadoop.hive.ql;
 
+import java.util.concurrent.TimeUnit;
+
 /**
- * The class is synchronized, as WebUI may access information about a running 
query.
+ * Provide WebUI information about a running query. Class is thread safe so 
that
+ * multiple browser sessions can access the data simultaneously.
  */
 public class QueryInfo {
 
   private final String userName;
   private final String executionEngine;
-  private final long beginTime;
   private final String operationId;
-  private Long runtime;  // tracks only running portion of the query.
 
-  private Long endTime;
   private String state;
   private QueryDisplay queryDisplay;
 
+  /*
+   * Times are stored internally with nanosecond precision.
+   */
+  private final long beginTime;
+  private long runtime;

Review comment:
       Thanks for the review.
   
   `synchronized` and `volatile` are not interchangeable.  This class doesn't 
need synchronization because all of its actions are so trivial, there is no 
issues with them happening concurrently: just assigning or reading a variable 
will not cause an issue with multiple threads.  The classic `volatile` case is 
when a thread is spinning, waiting on some variable to change values.  Without 
`volatile` the thread may cache the value and never stop spinning.  There is no 
such use case here, it is for informational purposes only.




----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 458656)
    Time Spent: 1h 50m  (was: 1h 40m)

> Review of QueryInfo Class
> -------------------------
>
>                 Key: HIVE-23793
>                 URL: https://issues.apache.org/jira/browse/HIVE-23793
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: David Mollitor
>            Assignee: David Mollitor
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>




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

Reply via email to