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


##########
core/src/main/java/org/apache/accumulo/core/metadata/StoredTabletFile.java:
##########
@@ -291,9 +291,28 @@ 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)),

Review Comment:
   You could use one of the 
[static](https://github.com/apache/accumulo/blob/05fe0713f778e15be08c1ae16ddd8136970bc446/core/src/main/java/org/apache/accumulo/core/metadata/StoredTabletFile.java#L171-L177)
 helper methods to create the StoredTabletFile which would make it a little 
simpler.
   
   



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