milleruntime commented on code in PR #2767:
URL: https://github.com/apache/accumulo/pull/2767#discussion_r895744270


##########
core/src/main/java/org/apache/accumulo/core/gc/Reference.java:
##########
@@ -19,50 +19,27 @@
 package org.apache.accumulo.core.gc;
 
 import org.apache.accumulo.core.data.TableId;
-import org.apache.accumulo.core.metadata.schema.MetadataSchema;
 
 /**
- * A GC reference to a tablet file or directory.
+ * A GC reference used for collecting files and directories into a single 
stream.
  */
-public class Reference implements Comparable<Reference> {
-  // parts of an absolute URI, like "hdfs://1.2.3.4/accumulo/tables/2a/t-0003"
-  public final TableId tableId; // 2a
+public interface Reference {
+  /**
+   * Only return true if the reference is a directory.
+   */
+  boolean isDirectory();
 
-  // the exact string that is stored in the metadata
-  public final String metadataEntry;
+  /**
+   * Get the {@link TableId} of the reference.
+   */
+  TableId getTableId();
 
-  public Reference(TableId tableId, String metadataEntry) {
-    
MetadataSchema.TabletsSection.ServerColumnFamily.validateDirCol(tableId.canonical());
-    this.tableId = tableId;
-    this.metadataEntry = 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 (this == obj)
-      return true;
-    if (obj == null)
-      return false;
-    if (getClass() != obj.getClass())
-      return false;
-    Reference other = (Reference) obj;
-    if (metadataEntry == null) {
-      return other.metadataEntry == null;
-    } else
-      return metadataEntry.equals(other.metadataEntry);
-  }
-
-  @Override
-  public int hashCode() {
-    return this.metadataEntry.hashCode();
-  }
+  /**
+   * Get the exact string stored in the metadata table for this file or 
directory. A file will be
+   * read from the Tablet "file" column family:

Review Comment:
   Which part?



-- 
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-unsubscr...@accumulo.apache.org

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

Reply via email to