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

Szehon Ho commented on HIVE-12987:
----------------------------------

Thanks Jimmy and Aihua for also taking a look.. i see now about the map and 
makes sense as its to make sure we only counting one user, I was also a bit 
confused.

Logic looks ok from my side then.  I have a style comment, can we get rid of 
SQLOperaiton's prevState field, and insteadt have the Operation pass in prev 
and new state to the callback?  My preference is to keep setMetrics() as 
private, and instead improve the onNewState() callback to take in new/old 
state, where SQLOperation can set it's own metrics there.  My reason is that 
Operation::setMetrics() has logic that should not be overriden by subclass for 
backward incompatibility, and instead dedicate the callback to be used to 
subclass to add on additional information.

And on that note also thanks for changing it to be backward compatible, I think 
that total operation is also helpful.

And just one other question, why is state changed to volatile?  Is it ever 
accessed in mutliple threads?  If not, we can change it back.

> Add metrics for HS2 active users and SQL operations
> ---------------------------------------------------
>
>                 Key: HIVE-12987
>                 URL: https://issues.apache.org/jira/browse/HIVE-12987
>             Project: Hive
>          Issue Type: Task
>            Reporter: Jimmy Xiang
>            Assignee: Jimmy Xiang
>         Attachments: HIVE-12987.1.patch, HIVE-12987.2.patch, 
> HIVE-12987.2.patch, HIVE-12987.3.patch, HIVE-12987.3.patch
>
>
> HIVE-12271 added metrics for all HS2 operations. Sometimes, users are also 
> interested in metrics just for SQL operations.
> It is useful to track active user count as well.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to