[
https://issues.apache.org/jira/browse/HADOOP-7350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13257590#comment-13257590
]
Alejandro Abdelnur commented on HADOOP-7350:
--------------------------------------------
+1
small NIT:
Where you do:
{code}
+ List<Class<? extends CompressionCodec>> result
+ = new ArrayList<Class<? extends CompressionCodec>>();
+ // Add codec classes discovered via service loading
+ for (CompressionCodec codec : CODEC_PROVIDERS) {
+ if (!result.contains(codec.getClass())) {
+ result.add(codec.getClass());
+ }
+ }
{code}
The IF NOT is not required as the ServiceLoader will ignore duplicate classes
in a non-deterministic way per ServiceLoader javadocs.
> Use ServiceLoader to discover compression codec classes
> -------------------------------------------------------
>
> Key: HADOOP-7350
> URL: https://issues.apache.org/jira/browse/HADOOP-7350
> Project: Hadoop Common
> Issue Type: Improvement
> Components: conf, io
> Reporter: Tom White
> Assignee: Tom White
> Attachments: HADOOP-7350.patch, HADOOP-7350.patch, HADOOP-7350.patch,
> HADOOP-7350.patch, HADOOP-7350.patch, HADOOP-7350.patch, HADOOP-7350.patch,
> HADOOP-7350.patch
>
>
> By using a ServiceLoader users wouldn't have to add codec classes to
> io.compression.codecs for codecs that aren't shipped with Hadoop (e.g. LZO),
> since they would be automatically picked up from the classpath.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira