You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "alan wootton (JIRA)" <ji...@apache.org> on 2006/05/04 23:50:18 UTC

[jira] Created: (HADOOP-196) Fix buggy uselessness of Configuration( Configuration other) constructor

Fix buggy uselessness of Configuration( Configuration other) constructor
------------------------------------------------------------------------

         Key: HADOOP-196
         URL: http://issues.apache.org/jira/browse/HADOOP-196
     Project: Hadoop
        Type: Bug

  Components: conf  
    Reporter: alan wootton


The constructor 
public Configuration(Configuration other) 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (HADOOP-196) Fix buggy uselessness of Configuration( Configuration other) constructor

Posted by "Sami Siren (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HADOOP-196?page=all ]

Sami Siren updated HADOOP-196:
------------------------------

               Status: Patch Available  (was: Open)
    Affects Version/s: 0.5.0

> Fix buggy uselessness of Configuration( Configuration other) constructor
> ------------------------------------------------------------------------
>
>                 Key: HADOOP-196
>                 URL: http://issues.apache.org/jira/browse/HADOOP-196
>             Project: Hadoop
>          Issue Type: Bug
>          Components: conf
>    Affects Versions: 0.5.0
>            Reporter: alan wootton
>         Attachments: ConfigConstructorFix.patch, hadoop-conf-patch.txt
>
>
> The constructor 
> public Configuration(Configuration other) 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HADOOP-196) Fix buggy uselessness of Configuration( Configuration other) constructor

Posted by "Lorenzo Thione (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HADOOP-196?page=comments#action_12420478 ] 

Lorenzo Thione commented on HADOOP-196:
---------------------------------------

Is there a reason why the patch was not submitted? I have encountered the same problem and patched it myself in a very similar way before finding out it had already been reported. Currently Configuration(conf) does not behave as expected.

Lorenzo Thione 
Powerset, Inc.

> Fix buggy uselessness of Configuration( Configuration other) constructor
> ------------------------------------------------------------------------
>
>          Key: HADOOP-196
>          URL: http://issues.apache.org/jira/browse/HADOOP-196
>      Project: Hadoop
>         Type: Bug

>   Components: conf
>     Reporter: alan wootton
>  Attachments: ConfigConstructorFix.patch
>
> The constructor 
> public Configuration(Configuration other) 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (HADOOP-196) Fix buggy uselessness of Configuration( Configuration other) constructor

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HADOOP-196?page=comments#action_12420572 ] 

Doug Cutting commented on HADOOP-196:
-------------------------------------

> Is there a reason why the patch was not submitted?

Not a good one.  I think it just fell off my radar.

It would be good to add a unit test for this.  I think the use case is roughly:

Configuration c1 = new Configuration();
c1.set("foo", "bar");
Configuratoin c2 = new Configuration(c1);
assertEquals(c2.get("foo"), "bar");

Is that right?

The provided patch would fix this, but by setting all the values except "foo" twice: once when reloaded from resources and once when reloaded from overrides.  Perhaps it would be better to put all resource-loaded properties in a nested Properties instance that's inherited via 'new Properties(Properties)' and only store values set directly in a top-level Properties instance.  Or perhaps we should just set most of the values twice and not worry about it.  Thoughts, anyone?

> Fix buggy uselessness of Configuration( Configuration other) constructor
> ------------------------------------------------------------------------
>
>          Key: HADOOP-196
>          URL: http://issues.apache.org/jira/browse/HADOOP-196
>      Project: Hadoop
>         Type: Bug

>   Components: conf
>     Reporter: alan wootton
>  Attachments: ConfigConstructorFix.patch
>
> The constructor 
> public Configuration(Configuration other) 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (HADOOP-196) Fix buggy uselessness of Configuration( Configuration other) constructor

Posted by "alan wootton (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HADOOP-196?page=comments#action_12379130 ] 

alan wootton commented on HADOOP-196:
-------------------------------------

Some mistakes in this submission (my first one, and I can't seem to edit them away).

Let me restate the bug.

This constructor

  public JobConf(Configuration conf) {
    super(conf);
    initialize();
  }

does not work as it should. The conf that is passed in gets lost.

The patch fixes this bug.

- alan wootton, shopping.com

> Fix buggy uselessness of Configuration( Configuration other) constructor
> ------------------------------------------------------------------------
>
>          Key: HADOOP-196
>          URL: http://issues.apache.org/jira/browse/HADOOP-196
>      Project: Hadoop
>         Type: Bug

>   Components: conf
>     Reporter: alan wootton
>  Attachments: ConfigConstructorFix.patch
>
> The constructor 
> public Configuration(Configuration other) 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (HADOOP-196) Fix buggy uselessness of Configuration( Configuration other) constructor

Posted by "alan wootton (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HADOOP-196?page=all ]

alan wootton updated HADOOP-196:
--------------------------------

    Attachment: ConfigConstructorFix.patch

> Fix buggy uselessness of Configuration( Configuration other) constructor
> ------------------------------------------------------------------------
>
>          Key: HADOOP-196
>          URL: http://issues.apache.org/jira/browse/HADOOP-196
>      Project: Hadoop
>         Type: Bug

>   Components: conf
>     Reporter: alan wootton
>  Attachments: ConfigConstructorFix.patch
>
> The constructor 
> public Configuration(Configuration other) 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (HADOOP-196) Fix buggy uselessness of Configuration( Configuration other) constructor

Posted by "alan wootton (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HADOOP-196?page=comments#action_12377895 ] 

alan wootton commented on HADOOP-196:
-------------------------------------

The constructor: 

	public Configuration(Configuration other)
	
sets the defaultResources, and the finalResources but does not use them 
because it then sets the properties to a clone of the other.properties.

If someone then calls addFinalResource (as does JobConf) then the
'other' properties are just lost. This becomes a problem if you attempt to use: 
	public JobConf(Class exampleClass)  

My fix (there are several possible ways to fix this) is to just remember
the other.properties and then overlay then whenever getProps() loads the resources.



> Fix buggy uselessness of Configuration( Configuration other) constructor
> ------------------------------------------------------------------------
>
>          Key: HADOOP-196
>          URL: http://issues.apache.org/jira/browse/HADOOP-196
>      Project: Hadoop
>         Type: Bug

>   Components: conf
>     Reporter: alan wootton
>  Attachments: ConfigConstructorFix.patch
>
> The constructor 
> public Configuration(Configuration other) 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (HADOOP-196) Fix buggy uselessness of Configuration( Configuration other) constructor

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HADOOP-196?page=all ]

Doug Cutting updated HADOOP-196:
--------------------------------

           Status: Resolved  (was: Patch Available)
    Fix Version/s: 0.6.0
       Resolution: Fixed

I just committed this.  Thanks, Sami!

> Fix buggy uselessness of Configuration( Configuration other) constructor
> ------------------------------------------------------------------------
>
>                 Key: HADOOP-196
>                 URL: http://issues.apache.org/jira/browse/HADOOP-196
>             Project: Hadoop
>          Issue Type: Bug
>          Components: conf
>    Affects Versions: 0.5.0
>            Reporter: alan wootton
>             Fix For: 0.6.0
>
>         Attachments: ConfigConstructorFix.patch, hadoop-conf-patch.txt
>
>
> The constructor 
> public Configuration(Configuration other) 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HADOOP-196) Fix buggy uselessness of Configuration( Configuration other) constructor

Posted by "Sami Siren (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HADOOP-196?page=all ]

Sami Siren updated HADOOP-196:
------------------------------

    Attachment: hadoop-conf-patch.txt

Attached patch fixes problem with current implementation, dynamically set properties are now preserved. Extension to testcase is also provided.

> Fix buggy uselessness of Configuration( Configuration other) constructor
> ------------------------------------------------------------------------
>
>                 Key: HADOOP-196
>                 URL: http://issues.apache.org/jira/browse/HADOOP-196
>             Project: Hadoop
>          Issue Type: Bug
>          Components: conf
>    Affects Versions: 0.5.0
>            Reporter: alan wootton
>         Attachments: ConfigConstructorFix.patch, hadoop-conf-patch.txt
>
>
> The constructor 
> public Configuration(Configuration other) 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira