hawq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mgoddard-pivotal <...@git.apache.org>
Subject [GitHub] incubator-hawq pull request #1365: Adding equals() to Fragment, to facilitat...
Date Tue, 15 May 2018 23:55:23 GMT
Github user mgoddard-pivotal commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1365#discussion_r188469835
  
    --- Diff: pxf/pxf-api/src/main/java/org/apache/hawq/pxf/api/Fragment.java ---
    @@ -140,4 +142,48 @@ public String getProfile() {
         public void setProfile(String profile) {
             this.profile = profile;
         }
    +
    +	@Override
    +	public int hashCode() {
    +		final int prime = 31;
    +		int result = 1;
    +		result = prime * result + index;
    +		result = prime * result + Arrays.hashCode(metadata);
    +		result = prime * result + ((profile == null) ? 0 : profile.hashCode());
    +		result = prime * result + Arrays.hashCode(replicas);
    +		result = prime * result + ((sourceName == null) ? 0 : sourceName.hashCode());
    +		result = prime * result + Arrays.hashCode(userData);
    +		return result;
    +	}
    +
    +	@Override
    +	public boolean equals(Object obj) {
    --- End diff --
    
    If it's the former, I should probably create a unit test to verify the behavior.  If it's
the latter, could you point me to some precedents within this codebase?


---

Mime
View raw message