cshannon commented on code in PR #3417:
URL: https://github.com/apache/accumulo/pull/3417#discussion_r1206831359
##########
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:
I searched and I didn't see any places where there is a comparison done,
it's usually used for logging and exceptions. However, there is actually one
spot in FileCompactor where it's
[used](https://github.com/apache/accumulo/blob/0017fd8949cc1bc7253b8e90313d4fd1b71e2241/server/base/src/main/java/org/apache/accumulo/server/compaction/FileCompactor.java#L195)
as the actual file so changing this would break things. That spot should
actually be fixed so I will update this PR to use getPathStr() instead.
--
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]