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


##########
core/src/main/java/org/apache/accumulo/core/metadata/StoredTabletFile.java:
##########
@@ -291,9 +291,41 @@ public TabletFileCq(Path path, Range range) {
     }
   }
 
-  private static class TabletFileCqMetadataGson {
+  static class TabletFileCqMetadataGson {
     private String path;
     private byte[] startRow;
     private byte[] endRow;
+
+    TabletFileCqMetadataGson() {}
+
+    TabletFileCqMetadataGson(AbstractTabletFile<?> atf) {
+      path = Objects.requireNonNull(atf.path.toString());
+      startRow = encodeRow(atf.range.getStartKey());
+      endRow = encodeRow(atf.range.getEndKey());
+    }
+
+    ReferencedTabletFile toReferencedTabletFile() {
+      return new ReferencedTabletFile(new Path(URI.create(path)),
+          new Range(decodeRow(startRow), true, decodeRow(endRow), false));
+    }
+
+    StoredTabletFile toStoredTabletFile() {
+      return new StoredTabletFile(new TabletFileCq(new Path(URI.create(path)),
+          new Range(decodeRow(startRow), true, decodeRow(endRow), false)));
+    }
+  }
+
+  static StoredTabletFile fomTabletFileCqMetadataGson(String serialized) {
+    return new StoredTabletFile(deserialize(serialized));
+  }

Review Comment:
   Good catch. This was left-over from an initial cut at fixing this. I removed 
it.



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