[
https://issues.apache.org/jira/browse/HADOOP-14333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15978642#comment-15978642
]
Steve Loughran commented on HADOOP-14333:
-----------------------------------------
Filesystems are a special case, not just because HDFS adds stuff, but because
there are fundamental differences between different filesystems (case
sensitivity, full posix seek+write, atomic dir rename, o(1) File rename,
consistent world view....). You can't declare that something supports this just
through an interface, as (a) it varies at runtime and (b)
{{FSDataOutputStream}} shows how base classes declare functionality which
subclasses end up rejecting by dynamically throwing exceptions.
without getting into the versioning row, note HADOOP-9565 has narrowed down to
some method on FileSystem to probe for features, something like
{code}
boolean hasFeature(Path, String)
{code}
Implementations can switch on the feature string, return true iff the feature
is present and enabled. There's been discussion of a similar problem related to
output stream features, we could do some similar interface here.
> New exception thrown by (private) DFSClient API isHDFSEncryptionEnabled broke
> hacky hive code
> ----------------------------------------------------------------------------------------------
>
> Key: HADOOP-14333
> URL: https://issues.apache.org/jira/browse/HADOOP-14333
> Project: Hadoop Common
> Issue Type: Bug
> Affects Versions: 2.8.1, 3.0.0-alpha3
> Reporter: Yongjun Zhang
> Assignee: Yongjun Zhang
> Attachments: HADOOP-14333.001.patch, HADOOP-14333.002.patch,
> HADOOP-14333.003.patch
>
>
> Though Hive should be fixed not to access DFSClient which is private to
> HADOOP, removing the throws added by HADOOP-14104 is a quicker solution to
> unblock hive.
> Hive code
> {code}
> private boolean isEncryptionEnabled(DFSClient client, Configuration conf) {
> try {
> DFSClient.class.getMethod("isHDFSEncryptionEnabled");
> } catch (NoSuchMethodException e) {
> // the method is available since Hadoop-2.7.1
> // if we run with an older Hadoop, check this ourselves
> return !conf.getTrimmed(DFSConfigKeys.DFS_ENCRYPTION_KEY_PROVIDER_URI,
> "").isEmpty();
> }
> return client.isHDFSEncryptionEnabled();
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]