hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom White (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-7077) Use Java's ServiceLoader to add default resources to Configuration
Date Thu, 23 Dec 2010 17:48:45 GMT

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

Tom White commented on HADOOP-7077:

To do this we would add an interface called ConfigurationResourceLoader or somesuch with a
single loadResources() method. The static initializer in Configuration would use ServiceLoader
to load the implementations of ConfigurationResourceLoader and call loadResources() on each
of them. Then in HDFS we would have an implementation of ConfigurationResourceLoader that
adds hdfs-default.xml and hdfs-site.xml. (And similarly for MapReduce.)

> Use Java's ServiceLoader to add default resources to Configuration
> ------------------------------------------------------------------
>                 Key: HADOOP-7077
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7077
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: conf
>            Reporter: Tom White
> Currently each class with a main() method (in HDFS and MapReduce) calls Configuration.addDefaultResource()
to add the names of resource files to load (e.g. see DataNode and NameNode which both add
hdfs-default.xml and hdfs-site.xml). We could reduce the code duplication by allowing the
use of [java.util.ServiceLoader|http://download.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html]
to do the initialization.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message