[
https://issues.apache.org/jira/browse/YARN-4630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15163144#comment-15163144
]
Akira AJISAKA commented on YARN-4630:
-------------------------------------
Found unnecessarily call of {{ApplicationAttemptId#compareTo}}.
{code:title=ContainerId.java}
public int compareTo(ContainerId other) {
if (this.getApplicationAttemptId().compareTo(
other.getApplicationAttemptId()) == 0) {
return Long.compare(getContainerId(), other.getContainerId());
} else {
return this.getApplicationAttemptId().compareTo(
other.getApplicationAttemptId());
}
}
{code}
Hi [~sarutak], would you keep the value of
{{this.getApplicationAttemptId().compareTo(other.getApplicationAttemptId())}}
and reuse it as follows?
{code}
public int compareTo(ContainerId other) {
int result = this.getApplicationAttemptId().compareTo(
other.getApplicationAttemptId());
if (result == 0) {
return Long.compare(getContainerId(), other.getContainerId());
} else {
return result;
}
}
{code}
> Remove useless boxing/unboxing code (Hadoop YARN)
> -------------------------------------------------
>
> Key: YARN-4630
> URL: https://issues.apache.org/jira/browse/YARN-4630
> Project: Hadoop YARN
> Issue Type: Improvement
> Components: yarn
> Affects Versions: 3.0.0
> Reporter: Kousuke Saruta
> Priority: Minor
> Attachments: YARN-4630.0.patch
>
>
> There are lots of places where useless boxing/unboxing occur.
> To avoid performance issue, let's remove them.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)