dlmarion commented on code in PR #2750:
URL: https://github.com/apache/accumulo/pull/2750#discussion_r892238037


##########
core/src/main/java/org/apache/accumulo/core/metadata/Reference.java:
##########
@@ -38,4 +38,28 @@ public Reference(TableId tableId, String metadataEntry) {
     this.metadataEntry = metadataEntry;
     this.tabletDir = metadataEntry;
   }
+
+  @Override
+  public int compareTo(Reference that) {
+    if (equals(that)) {
+      return 0;
+    } else {
+      return this.metadataEntry.compareTo(that.metadataEntry);
+    }
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (obj instanceof Reference) {
+      Reference that = (Reference) obj;
+      return this.metadataEntry.equals(that.metadataEntry);
+    } else {
+      return false;
+    }
+  }

Review Comment:
   Yeah, I agree. It seems to me that the other two fields could be parsed out 
of the metadata entry, but that's only the case if the entry is *not* relative. 
I remember many versions ago that the file references were not fully qualified 
in the metadata table. When we added the ability to support multiple volumes 
@ericnewton made all of the file references fully qualified. I think it was out 
of need, but also being specific probably made the code a little easier. I'm 
surprised that we went backwards to *not* using fully qualified references.



-- 
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]

Reply via email to