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

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

                Author: ASF GitHub Bot
            Created on: 25/Jan/22 10:42
            Start Date: 25/Jan/22 10:42
    Worklog Time Spent: 10m 
      Work Description: pvary commented on a change in pull request #2967:
URL: https://github.com/apache/hive/pull/2967#discussion_r791581995



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
##########
@@ -169,65 +169,29 @@
   private Warehouse wh; // hdfs warehouse
   private static Striped<Lock> tablelocks;
 
-  private static final ThreadLocal<RawStore> threadLocalMS = new 
ThreadLocal<RawStore>();
-  private static final ThreadLocal<TxnStore> threadLocalTxn = new 
ThreadLocal<TxnStore>();
-
-  private static final ThreadLocal<Map<String, 
com.codahale.metrics.Timer.Context>> timerContexts =
-      new ThreadLocal<Map<String, com.codahale.metrics.Timer.Context>>() {
-        @Override
-        protected Map<String, com.codahale.metrics.Timer.Context> 
initialValue() {
-          return new HashMap<>();
-        }
-      };
-
   public static RawStore getRawStore() {
-    return threadLocalMS.get();
+    return HMSHandlerContext.getRawStore().orElse(null);
   }
 
   static void cleanupRawStore() {

Review comment:
       This is not a `cleanupRawStore` for a good while...
   How widely used is this? Could we rename this? 




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

To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org

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


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

    Worklog Id:     (was: 714373)
    Time Spent: 40m  (was: 0.5h)

> Group HMSHandler's thread locals into a single context
> ------------------------------------------------------
>
>                 Key: HIVE-25892
>                 URL: https://issues.apache.org/jira/browse/HIVE-25892
>             Project: Hive
>          Issue Type: Improvement
>          Components: Standalone Metastore
>            Reporter: Zhihua Deng
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> There are more than six ThreadLocal variables in HMSHandler, we can group 
> them together into a single context to improve the management of variables 
> and the code readability.
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to