YARN-297. Improve hashCode implementations for PB records. Contributed by Xuan Gong.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1459054 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hitesh Shah 2013-03-20 21:09:33 +00:00
parent 1bd345d6e3
commit 2703518240
7 changed files with 15 additions and 12 deletions

View File

@ -78,6 +78,9 @@ Release 2.0.5-beta - UNRELEASED
YARN-481. Add AM Host and RPC Port to ApplicationCLI Status Output YARN-481. Add AM Host and RPC Port to ApplicationCLI Status Output
(Chris Riccomini via bikas) (Chris Riccomini via bikas)
YARN-297. Improve hashCode implementations for PB records. (Xuan Gong via
hitesh)
OPTIMIZATIONS OPTIMIZATIONS
BUG FIXES BUG FIXES

View File

@ -76,8 +76,8 @@ public NumberFormat initialValue() {
@Override @Override
public int hashCode() { public int hashCode() {
// Generated by eclipse. // Generated by eclipse.
final int prime = 31; final int prime = 347671;
int result = 1; int result = 5501;
ApplicationId appId = getApplicationId(); ApplicationId appId = getApplicationId();
result = prime * result + appId.hashCode(); result = prime * result + appId.hashCode();
result = prime * result + getAttemptId(); result = prime * result + getAttemptId();

View File

@ -97,8 +97,8 @@ public String toString() {
@Override @Override
public int hashCode() { public int hashCode() {
// Generated by eclipse. // Generated by eclipse.
final int prime = 31; final int prime = 371237;
int result = 1; int result = 6521;
long clusterTimestamp = getClusterTimestamp(); long clusterTimestamp = getClusterTimestamp();
result = prime * result result = prime * result
+ (int) (clusterTimestamp ^ (clusterTimestamp >>> 32)); + (int) (clusterTimestamp ^ (clusterTimestamp >>> 32));

View File

@ -86,8 +86,8 @@ public NumberFormat initialValue() {
@Override @Override
public int hashCode() { public int hashCode() {
// Generated by eclipse. // Generated by eclipse.
final int prime = 31; final int prime = 435569;
int result = 1; int result = 7507;
result = prime * result + getId(); result = prime * result + getId();
result = prime * result + getApplicationAttemptId().hashCode(); result = prime * result + getApplicationAttemptId().hashCode();
return result; return result;

View File

@ -65,8 +65,8 @@ public String toString() {
@Override @Override
public int hashCode() { public int hashCode() {
final int prime = 31; final int prime = 493217;
int result = 1; int result = 8501;
result = prime * result + this.getHost().hashCode(); result = prime * result + this.getHost().hashCode();
result = prime * result + this.getPort(); result = prime * result + this.getPort();
return result; return result;

View File

@ -39,8 +39,8 @@ public abstract class Priority implements Comparable<Priority> {
@Override @Override
public int hashCode() { public int hashCode() {
final int prime = 31; final int prime = 517861;
int result = 1; int result = 9511;
result = prime * result + getPriority(); result = prime * result + getPriority();
return result; return result;
} }

View File

@ -124,8 +124,8 @@ public abstract class ResourceRequest implements Comparable<ResourceRequest> {
@Override @Override
public int hashCode() { public int hashCode() {
final int prime = 31; final int prime = 2153;
int result = 1; int result = 2459;
Resource capability = getCapability(); Resource capability = getCapability();
String hostName = getHostName(); String hostName = getHostName();
Priority priority = getPriority(); Priority priority = getPriority();