You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Keith Turner (JIRA)" <ji...@apache.org> on 2019/01/25 16:58:00 UTC

[jira] [Comment Edited] (HADOOP-11223) Offer a read-only conf alternative to new Configuration()

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

Keith Turner edited comment on HADOOP-11223 at 1/25/19 4:57 PM:
----------------------------------------------------------------

It would be nice if Configuraiton had a static method like Collections.unmodifiableXXX.


{code:java}
Configuraiton conf  = new Configuration();

//wrap conf with a class that throws exception on set
Configuration readonlyConf = Configuration.umodifiable(conf);
{code}



was (Author: kturner):
It would be nice if Configuraiton had a static method like Collections.unmodifiableXXX.


{code:java}
Configuraiton conf  = new Configuration();

//wrap conf with a class that throws exception on set
Configuraiton readonlyConf = Configuration.umodifiable(conf);
{code}


> 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
>            Priority: Major
>              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
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org