You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "ctubbsii (via GitHub)" <gi...@apache.org> on 2023/05/25 19:49:46 UTC

[GitHub] [accumulo] ctubbsii commented on a diff in pull request #3417: Refactor StoredTabletFile to contain a TabletFile

ctubbsii commented on code in PR #3417:
URL: https://github.com/apache/accumulo/pull/3417#discussion_r1205944202


##########
core/src/main/java/org/apache/accumulo/core/metadata/StoredTabletFile.java:
##########
@@ -71,4 +92,40 @@ public void validate(String reference) {
           + " does not match what was in the metadata: " + metadataEntry);
     }
   }
+
+  @Override
+  public int compareTo(StoredTabletFile o) {
+    if (equals(o)) {
+      return 0;
+    } else {
+      return metadataEntry.compareTo(o.metadataEntry);
+    }
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+    StoredTabletFile that = (StoredTabletFile) o;
+    return Objects.equals(metadataEntry, that.metadataEntry);
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(metadataEntry);
+  }
+
+  @Override
+  public String toString() {
+    return metadataEntry;

Review Comment:
   Anything you would add would probably break things that are reading the `toString()`, so you'd be potentially creating more runtime bugs to fix one potential runtime bug. Not sure if that's worth it. Either way, would need to track down who is calling toString on these, and figuring out what they're using it for in each case.



-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org