[
https://issues.apache.org/jira/browse/HADOOP-10886?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Uma Maheswara Rao G updated HADOOP-10886:
-----------------------------------------
Attachment: HADOOP-10886.patch
Attached a patch with what I am thinking to fix this issue.
[~andrew.wang], Could you please take a look at this?
Now CrptoCodec#getInstance may return null in the case of no configuration. We
can not throw exception as DFSClient may fail to initialize as we do
initialization of codec in DFSClient's Ctor.
TestDistributedFileSystem#testAllWithNoXmlDefaults is trying to verify the
server basoc with no default xmls loaded. But if there an exception due to no
configurations in xml, then dfsClient initialization itself will fail. So, it
will mandate to configure that codec related configurations. So,To avoid this,
now we simply return null if no configuration available with a log and has
javadoc updated about the behaviour.
> CryptoCodec#getCodecclasses throws NPE when configurations not loaded.
> ----------------------------------------------------------------------
>
> Key: HADOOP-10886
> URL: https://issues.apache.org/jira/browse/HADOOP-10886
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: fs
> Affects Versions: fs-encryption (HADOOP-10150 and HDFS-6134)
> Reporter: Uma Maheswara Rao G
> Assignee: Uma Maheswara Rao G
> Fix For: 3.0.0
>
> Attachments: HADOOP-10886.patch
>
>
> There are some test cases which will not load the xml defaults. In this case,
> CryptoCodec#getCodecclasses will fail with NPE.
> {noformat}
> java.lang.NullPointerException: null
> at
> com.google.common.base.Preconditions.checkNotNull(Preconditions.java:187)
> at com.google.common.base.Splitter.split(Splitter.java:371)
> at
> org.apache.hadoop.crypto.CryptoCodec.getCodecClasses(CryptoCodec.java:100)
> at
> org.apache.hadoop.crypto.CryptoCodec.getInstance(CryptoCodec.java:54)
> at
> org.apache.hadoop.crypto.CryptoCodec.getInstance(CryptoCodec.java:91)
> at
> org.apache.hadoop.crypto.TestCryptoStreamsForLocalFS.init(TestCryptoStreamsForLocalFS.java:53)
> {noformat}
> https://builds.apache.org/job/Hadoop-fs-encryption-nightly/71/
--
This message was sent by Atlassian JIRA
(v6.2#6252)