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

Vihang Karajgaonkar commented on HIVE-17371:
--------------------------------------------

Thanks for taking a look [~thejas] 

Functionality-vise in case of HiveDelegationTokenManager, it doesn't do 
anything specific for HS2 except that it defines some delegation token specific 
default configuration values like key update interval, token renewal and 
lifetime durations. Other than that it has some ZK specific configs like the 
default ZNODE name and timeout value. Based on my understanding these look like 
something which are specific to Hive than standalone metastore. 

In case of TokenStoreDelegationTokenSecretManager extends 
DelegationTokenSecretManager which extends 
AbstractDelegationTokenSecretManager<DelegationTokenIdentifier>. Since the 
DelegationTokenIdentifier defines the delegation token kind as 
{{HIVE_DELEGATION_TOKEN}} we can argue this as Hive server's delegation token 
identifier implementation. Moving the class hierarchy of 
TokenStoreDelegationTokenSecretManager to standalone-metastore might not be 
ideal because then hive-shims project will depend on metastore which doesn't 
seem right.

Let me know if you have any thoughts or if I am missing something.

> Move tokenstores to metastore module
> ------------------------------------
>
>                 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
>         Attachments: HIVE-17371.01.patch
>
>
> 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)

Reply via email to