You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by pt...@apache.org on 2014/04/21 21:44:13 UTC

[14/50] [abbrv] git commit: fix trident keep refreshing partition issue

fix trident keep refreshing partition issue


Project: http://git-wip-us.apache.org/repos/asf/incubator-storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-storm/commit/0a6203ac
Tree: http://git-wip-us.apache.org/repos/asf/incubator-storm/tree/0a6203ac
Diff: http://git-wip-us.apache.org/repos/asf/incubator-storm/diff/0a6203ac

Branch: refs/heads/master
Commit: 0a6203acc6a2765049af6913b8deb070fb63a244
Parents: f789091
Author: Edison Xu <xe...@gmail.com>
Authored: Wed Jan 22 15:07:04 2014 +0800
Committer: Edison Xu <xe...@gmail.com>
Committed: Wed Jan 22 15:07:04 2014 +0800

----------------------------------------------------------------------
 .../trident/GlobalPartitionInformation.java     | 26 ++++++++++++++++++++
 1 file changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/0a6203ac/src/jvm/storm/kafka/trident/GlobalPartitionInformation.java
----------------------------------------------------------------------
diff --git a/src/jvm/storm/kafka/trident/GlobalPartitionInformation.java b/src/jvm/storm/kafka/trident/GlobalPartitionInformation.java
index a790009..e73d6b0 100644
--- a/src/jvm/storm/kafka/trident/GlobalPartitionInformation.java
+++ b/src/jvm/storm/kafka/trident/GlobalPartitionInformation.java
@@ -64,4 +64,30 @@ public class GlobalPartitionInformation implements Iterable<Partition>, Serializ
             }
         };
     }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result
+                + ((partitionMap == null) ? 0 : partitionMap.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        GlobalPartitionInformation other = (GlobalPartitionInformation) obj;
+        if (partitionMap == null) {
+            if (other.partitionMap != null)
+                return false;
+        } else if (!partitionMap.equals(other.partitionMap))
+            return false;
+        return true;
+    }
 }