dengzhhu653 commented on code in PR #6585:
URL: https://github.com/apache/hive/pull/6585#discussion_r3548110963
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java:
##########
@@ -412,27 +410,23 @@ public boolean openTransaction() {
return result;
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("unchecked, rawtypes")
@Override
public <T> T unwrap(Class<T> iface) {
+ if (pm == null) {
+ throw new IllegalStateException("ObjectStore hasn't been initialized
yet");
+ }
MetaDescriptor descriptor = iface.getAnnotation(MetaDescriptor.class);
if (descriptor == null) {
throw new IllegalArgumentException("Unable to unwrap the store as " +
iface);
}
- String implClassName = conf.get("metastore." + descriptor.alias() +
".store.impl", "");
- T simpl;
- T impl = (T) cachedImpls.get(iface);
Review Comment:
`unwrap` is like create a new instance in java, and rely on RawStoreBundle
to get the context, it shouldn't add much overhead.
I have checked and removed the `unwrap` call in the loop
--
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]