hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Cutting (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HADOOP-387) LocalJobRunner assigns duplicate mapid's
Date Wed, 26 Jul 2006 07:31:14 GMT
     [ http://issues.apache.org/jira/browse/HADOOP-387?page=all ]

Doug Cutting resolved HADOOP-387.
---------------------------------

    Fix Version/s: 0.5.0
       Resolution: Fixed

I just committed this.  Thanks, Sami!

> LocalJobRunner assigns duplicate mapid's
> ----------------------------------------
>
>                 Key: HADOOP-387
>                 URL: http://issues.apache.org/jira/browse/HADOOP-387
>             Project: Hadoop
>          Issue Type: Bug
>          Components: mapred
>    Affects Versions: 0.4.0
>         Environment: xp, cygwin, jdk1.4.2_12
>            Reporter: Sami Siren
>             Fix For: 0.5.0
>
>         Attachments: hadoop-fix-dup-id-0.4.patch, hadoop-fix-dup-id-trunk.patch
>
>
> While hunting down nutch issue NUTCH-266 i discovered that id's are generated with following
fragment of code:
>     private String newId() {
>       return Integer.toString(Math.abs(new Random().nextInt()),36);
>     }
> and the related Javadoc:
> "
> public Random()
>     Creates a new random number generator. Its seed is initialized to a value based on
the current time:
>          public Random() { this(System.currentTimeMillis()); }
>     Two Random objects created within the same millisecond will have the same sequence
of random numbers.
> "
> it appears that in this case there are more than one Random pobject generated at the
same millisecond and id's are
> no longer unique.

-- 
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

        

Mime
View raw message