hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Douglas (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-4276) The mapred.*ID classes are inefficient for hashCode and serialization
Date Wed, 22 Oct 2008 20:27:46 GMT

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

Chris Douglas commented on HADOOP-4276:
---------------------------------------

This looks good. Just a few suggestions/nits:
* In JobID:
{noformat}
-      .append(jtIdentifier != null ? jtIdentifier : "[^_]*").append(UNDERSCORE)
+      .append(jtIdentifier != null ? jtIdentifier : "[^_]*").append(SEPARATOR)
{noformat}
the regexp "[^_]" should probably use the SEPARATOR constant
* Where this replaces calls to ID factories with instances created in the cstr (JobProfile,
TaskReport, TaskStatus, TaskCompletionEvent, TaskAttemptID, Task, KillTaskAction, KillJobAction,
JobStatus) it might make sense to make the instance final
* In TaskID:
{noformat}
-      else return this.isMap ? -1 : 1;
+      else {
+        return this.isMap ? -1 : 1;
+      }
{noformat}
The else is redundant
* {{addId}} reads like a mutator. Would {{addIdTo}} or {{appendIdTo}} make more sense?

> The mapred.*ID classes are inefficient for hashCode and serialization
> ---------------------------------------------------------------------
>
>                 Key: HADOOP-4276
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4276
>             Project: Hadoop Core
>          Issue Type: Improvement
>            Reporter: Owen O'Malley
>            Assignee: Owen O'Malley
>             Fix For: 0.20.0
>
>         Attachments: h4276.patch
>
>
> Currently the ID classes call toString and hash the resulting string rather than computing
a hash directly.
> The ID classes also create new instances of the higher level object in readFields (via
read) rather than re-using the object via readFields.

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


Mime
View raw message