>From Peeyush Gupta <[email protected]>:
Peeyush Gupta has uploaded this change for review. (
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17859 )
Change subject: [NO ISSUE][OTH] Add hashcode and equals function to
ComputePartition
......................................................................
[NO ISSUE][OTH] Add hashcode and equals function to ComputePartition
- user model changes: no
- storage format changes: no
- interface changes: no
Change-Id: If05b1e443c7fb49cd4a3bfef5646d4e468c99d04
---
M
asterixdb/asterix-common/src/main/java/org/apache/asterix/common/cluster/ComputePartition.java
1 file changed, 29 insertions(+), 0 deletions(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb
refs/changes/59/17859/1
diff --git
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/cluster/ComputePartition.java
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/cluster/ComputePartition.java
index 1d11c30..540eb69 100644
---
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/cluster/ComputePartition.java
+++
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/cluster/ComputePartition.java
@@ -18,6 +18,8 @@
*/
package org.apache.asterix.common.cluster;
+import java.util.Objects;
+
public class ComputePartition {
private final String nodeId;
private final int id;
@@ -34,4 +36,18 @@
public int getId() {
return id;
}
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(nodeId, id);
+ }
+
+ @Override
+ public boolean equals(Object object) {
+ if (!(object instanceof ComputePartition)) {
+ return false;
+ }
+ ComputePartition target = (ComputePartition) object;
+ return Objects.equals(id, target.getId()) && Objects.equals(nodeId,
target.getNodeId());
+ }
}
--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17859
To unsubscribe, or for help writing mail filters, visit
https://asterix-gerrit.ics.uci.edu/settings
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: If05b1e443c7fb49cd4a3bfef5646d4e468c99d04
Gerrit-Change-Number: 17859
Gerrit-PatchSet: 1
Gerrit-Owner: Peeyush Gupta <[email protected]>
Gerrit-MessageType: newchange