dengzhhu653 commented on a change in pull request #2967:
URL: https://github.com/apache/hive/pull/2967#discussion_r791589935
##########
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:
It's been used only in two places(HMSHandler&HiveMetaStore) when client
disconnects,can we rename it to `cleanupContext` with public modifier? Thank
you for the suggestions!
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]