hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Venkatesh Sridharan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-16277) Expose getTokenKind method in FileSystem
Date Thu, 25 Apr 2019 20:33:00 GMT

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

Venkatesh Sridharan commented on HADOOP-16277:
----------------------------------------------

Thanks for the quick response!

I think it just makes it easier to not worry about the underlying fileSystem implementation.
For ex:

if I want to get the delegation token of a FileSystem from a User, I can just do this
{code:java}
User.getToken(fs.getTokenKind(), fs.getCanonicalServiceName()){code}
Not having the token kind leads me to know what the FileSystem implementation is and get token
kind based off that.

Ex:
{code:java}
if (fs.getUri().getScheme().equalsIgnoreCase(SWebHdfsFileSystem.SCHEME)) {
  User.getToken(SWebHdfsFileSystem.TOKEN_KIND, fs.getCanonicalServiceName())
} else if (fs.getUri().getScheme().equalsIgnoreCase(WebHdfsFileSystem.SCHEME)) {
  User.getToken(WebHdfsFileSystem.TOKEN_KIND, fs.getCanonicalServiceName())
}

{code}
I know its a really trivial change to do. Just thought it might be useful. Let me know if
you think otherwise. I can close it. Thanks!

> Expose getTokenKind method in FileSystem
> ----------------------------------------
>
>                 Key: HADOOP-16277
>                 URL: https://issues.apache.org/jira/browse/HADOOP-16277
>             Project: Hadoop Common
>          Issue Type: Improvement
>            Reporter: Venkatesh Sridharan
>            Priority: Trivial
>
> It would be nice to have a getTokenKind() method exposed in [FileSystem|[https://github.com/apache/hadoop-common/blob/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java]]
. Currently WebHdfsFileSystem class has getTokenKind() which is protected. Having it in FileSystem
makes it easier to use at runtime when the consumer doesn't know what the underlying FileSystem
implementation is. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message