This is an automated email from the ASF dual-hosted git repository.
hxd pushed a commit to branch delete_dev1
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/delete_dev1 by this push:
new 014aa86 add hashCode() method
014aa86 is described below
commit 014aa86d034ef5bd6120cacd835df43929f9e9c6
Author: xiangdong huang <[email protected]>
AuthorDate: Fri Feb 15 14:48:18 2019 +0800
add hashCode() method
---
.../java/org/apache/iotdb/db/engine/modification/Deletion.java | 7 +++++++
.../org/apache/iotdb/db/engine/modification/Modification.java | 9 ++++++++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git
a/iotdb/src/main/java/org/apache/iotdb/db/engine/modification/Deletion.java
b/iotdb/src/main/java/org/apache/iotdb/db/engine/modification/Deletion.java
index 81d800a..bf59f04 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/modification/Deletion.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/modification/Deletion.java
@@ -19,6 +19,8 @@
package org.apache.iotdb.db.engine.modification;
+import java.util.Objects;
+
/**
* Deletion is a delete operation on a timeseries.
*/
@@ -45,4 +47,9 @@ public class Deletion extends Modification {
Deletion del = (Deletion) obj;
return super.equals(obj) && del.timestamp == this.timestamp;
}
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(super.hashCode(), timestamp);
+ }
}
diff --git
a/iotdb/src/main/java/org/apache/iotdb/db/engine/modification/Modification.java
b/iotdb/src/main/java/org/apache/iotdb/db/engine/modification/Modification.java
index 8d0956f..81186a1 100644
---
a/iotdb/src/main/java/org/apache/iotdb/db/engine/modification/Modification.java
+++
b/iotdb/src/main/java/org/apache/iotdb/db/engine/modification/Modification.java
@@ -19,6 +19,8 @@
package org.apache.iotdb.db.engine.modification;
+import java.util.Objects;
+
/**
* Modification represents an UPDATE or DELETE operation on a certain
timeseries.
*/
@@ -28,7 +30,7 @@ public abstract class Modification {
protected String path;
protected long versionNum;
- public Modification(Type type, String path, long versionNum) {
+ Modification(Type type, String path, long versionNum) {
this.type = type;
this.path = path;
this.versionNum = versionNum;
@@ -70,4 +72,9 @@ public abstract class Modification {
return mod.type.equals(this.type) && mod.path.equals(this.path)
&& mod.versionNum == this.versionNum;
}
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(type, path, versionNum);
+ }
}