smengcl commented on code in PR #4490:
URL: https://github.com/apache/ozone/pull/4490#discussion_r1167263247


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffJob.java:
##########
@@ -113,6 +121,61 @@ public void setForceFullDiff(boolean forceFullDiff) {
     this.forceFullDiff = forceFullDiff;
   }
 
+  public long getCreationTime() {
+    return creationTime;
+  }
+
+  public void setCreationTime(long creationTime) {
+    this.creationTime = creationTime;
+  }
+
+  public long getTotalDiffEntries() {
+    return totalDiffEntries;
+  }
+
+  public void setTotalDiffEntries(long totalDiffEntries) {
+    this.totalDiffEntries = totalDiffEntries;
+  }
+
+  @Override
+  public String toString() {
+    return "creationTime : " + creationTime +
+        ", jobId: " + jobId +
+        ", status: " + status +
+        ", volume: " + volume +
+        ", bucket: " + bucket +
+        ", fromSnapshot: " + fromSnapshot +
+        ", toSnapshot: " + toSnapshot +
+        ", forceFullDiff: " + forceFullDiff +
+        ", totalDiffEntries: " + totalDiffEntries;
+  }
+
+  @Override
+  public boolean equals(Object other) {
+    if (this == other) {
+      return true;
+    }
+
+    if (other instanceof SnapshotDiffJob) {
+      SnapshotDiffJob otherJob = (SnapshotDiffJob) other;
+      return Objects.equals(this.creationTime, otherJob.creationTime) &&
+          Objects.equals(this.jobId, otherJob.jobId) &&
+          Objects.equals(this.status, otherJob.status) &&
+          Objects.equals(this.volume, otherJob.volume) &&
+          Objects.equals(this.bucket, otherJob.bucket) &&
+          Objects.equals(this.fromSnapshot, otherJob.fromSnapshot) &&
+          Objects.equals(this.toSnapshot, otherJob.toSnapshot) &&
+          Objects.equals(this.forceFullDiff, otherJob.forceFullDiff) &&
+          Objects.equals(this.totalDiffEntries, otherJob.totalDiffEntries);
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(jobId);

Review Comment:
   hash other variables as well? whatever else is involved in `toString`  in 
your previous impl
   
   ```suggestion
       return Objects.hash(creationTime, jobId, status, ...);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to