You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sqoop.apache.org by ja...@apache.org on 2015/01/05 11:22:01 UTC

sqoop git commit: SQOOP-1940: Add hashcode and equals methods to SqoopWritable

Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 08b2418c5 -> e8a4a97fe


SQOOP-1940: Add hashcode and equals methods to SqoopWritable

(Veena Basavaraj via Jarek Jarcec Cecho)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/e8a4a97f
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/e8a4a97f
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/e8a4a97f

Branch: refs/heads/sqoop2
Commit: e8a4a97fe2726218ad41c25d238bd5a2042f97ec
Parents: 08b2418
Author: Jarek Jarcec Cecho <ja...@apache.org>
Authored: Mon Jan 5 11:20:49 2015 +0100
Committer: Jarek Jarcec Cecho <ja...@apache.org>
Committed: Mon Jan 5 11:20:49 2015 +0100

----------------------------------------------------------------------
 .../org/apache/sqoop/job/io/SqoopWritable.java  | 32 ++++++++++++++++++++
 1 file changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/e8a4a97f/execution/mapreduce/src/main/java/org/apache/sqoop/job/io/SqoopWritable.java
----------------------------------------------------------------------
diff --git a/execution/mapreduce/src/main/java/org/apache/sqoop/job/io/SqoopWritable.java b/execution/mapreduce/src/main/java/org/apache/sqoop/job/io/SqoopWritable.java
index 5967f5c..08c2031 100644
--- a/execution/mapreduce/src/main/java/org/apache/sqoop/job/io/SqoopWritable.java
+++ b/execution/mapreduce/src/main/java/org/apache/sqoop/job/io/SqoopWritable.java
@@ -90,4 +90,36 @@ public class SqoopWritable implements Configurable, WritableComparable<SqoopWrit
   public Configuration getConf() {
     return conf;
   }
+
+  /* (non-Javadoc)
+   * @see java.lang.Object#hashCode()
+   */
+  @Override
+  public int hashCode() {
+    final int prime = 31;
+    int result = 1;
+    result = prime * result + ((toIDF == null) ? 0 : toIDF.hashCode());
+    return result;
+  }
+
+  /* (non-Javadoc)
+   * @see java.lang.Object#equals(java.lang.Object)
+   */
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj)
+      return true;
+    if (obj == null)
+      return false;
+    if (getClass() != obj.getClass())
+      return false;
+    SqoopWritable other = (SqoopWritable) obj;
+    if (toIDF == null) {
+      if (other.toIDF != null)
+        return false;
+    } else if (!toIDF.equals(other.toIDF))
+      return false;
+    return true;
+  }
+
 }