[
https://issues.apache.org/jira/browse/HIVE-17371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16161672#comment-16161672
]
Vihang Karajgaonkar commented on HIVE-17371:
--------------------------------------------
By thrift classes do you mean thrift generated classes or the classes in the
{{org.apache.hadoop.hive.thrift}} package in shims-common? I find it a little
confusing why we have thrift in the package name since they are not really
auto-generated but our wrappers around Thrift/hadoop classes. If we decide to
move instead of copy, it would mean move ZKTokenStore as well and the
associated TokenStoreManager classes as well. In order to keep it compatible
with the old configuration values, we will need to handle the mapping in HS2 as
well. For instance if the hive-site.xml provides old class names, we recognize
these and instantiate corresponding new classes from Metastore package.
[~vgumashta] I have a change which is almost ready where I moved DBTokenStore
and ZKTokenStore but may need more work to move MemoryTokenStore and the
TokenStoreManager classes as well. Does this make sense to you? Let us know if
you have any opinion/suggestions. Thanks!
> Fix DBTokenStore and ZKTokenStore for the stand-alone metastore
> ---------------------------------------------------------------
>
> Key: HIVE-17371
> URL: https://issues.apache.org/jira/browse/HIVE-17371
> Project: Hive
> Issue Type: Sub-task
> Components: Metastore
> Reporter: Vihang Karajgaonkar
> Assignee: Vihang Karajgaonkar
>
> The {{getTokenStore}} method will not work for the {{DBTokenStore}} and
> {{ZKTokenStore}} since they implement
> {{org.apache.hadoop.hive.thrift.DelegationTokenStore}} instead of
> {{org.apache.hadoop.hive.metastore.security.DelegationTokenStore}}
> {code}
> private DelegationTokenStore getTokenStore(Configuration conf) throws
> IOException {
> String tokenStoreClassName =
> MetastoreConf.getVar(conf,
> MetastoreConf.ConfVars.DELEGATION_TOKEN_STORE_CLS, "");
> // The second half of this if is to catch cases where users are passing
> in a HiveConf for
> // configuration. It will have set the default value of
> // "hive.cluster.delegation.token.store .class" to
> // "org.apache.hadoop.hive.thrift.MemoryTokenStore" as part of its
> construction. But this is
> // the hive-shims version of the memory store. We want to convert this
> to our default value.
> if (StringUtils.isBlank(tokenStoreClassName) ||
>
> "org.apache.hadoop.hive.thrift.MemoryTokenStore".equals(tokenStoreClassName))
> {
> return new MemoryTokenStore();
> }
> try {
> Class<? extends DelegationTokenStore> storeClass =
>
> Class.forName(tokenStoreClassName).asSubclass(DelegationTokenStore.class);
> return ReflectionUtils.newInstance(storeClass, conf);
> } catch (ClassNotFoundException e) {
> throw new IOException("Error initializing delegation token store: " +
> tokenStoreClassName, e);
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)