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

Colin Patrick McCabe commented on HADOOP-11223:
-----------------------------------------------

I don't see this as something we can really commit at this point.  We would 
need to see some examples of actually using this. (i.e. changing NativeIO.java, 
SecurityUtil, etc. to use it).

The current patch also doesn't do anything to make the configuration read-only, 
which could lead to race conditions during startup (we have some people setting 
configuration keys).  Given how many problems we've had with this kind of thing 
in the past, I think it's important to address this.

Maybe we should just have this method hand out copies of the configuration that 
it loads.  Yes, there will be some overhead from the Configuration object copy, 
but it will be much, much less than the overhead of parsing XML files from the 
disk.

> Offer a read-only conf alternative to new Configuration()
> ---------------------------------------------------------
>
>                 Key: HADOOP-11223
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11223
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: conf
>            Reporter: Gopal V
>            Assignee: Varun Saxena
>              Labels: Performance
>         Attachments: HADOOP-11223.001.patch
>
>
> new Configuration() is called from several static blocks across Hadoop.
> This is incredibly inefficient, since each one of those involves primarily 
> XML parsing at a point where the JIT won't be triggered & interpreter mode is 
> essentially forced on the JVM.
> The alternate solution would be to offer a {{Configuration::getDefault()}} 
> alternative which disallows any modifications.
> At the very least, such a method would need to be called from 
> # org.apache.hadoop.io.nativeio.NativeIO::<clinit>()
> # org.apache.hadoop.security.SecurityUtil::<clinit>()
> # org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider::<clinit>



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to