ctubbsii commented on code in PR #5906:
URL: https://github.com/apache/accumulo/pull/5906#discussion_r2370372150


##########
core/src/main/java/org/apache/accumulo/core/clientImpl/TabletMergeabilityUtil.java:
##########
@@ -80,23 +80,19 @@ public static String encode(Text split, TabletMergeability 
tabletMergeability) {
     return gson.toJson(jData);
   }
 
-  public static ByteBuffer encodeAsBuffer(Pair<Text,TabletMergeability> split) 
{
-    return ByteBuffer.wrap(encode(split).getBytes(UTF_8));
+  public static ByteBuffer encodeAsBuffer(SplitMergeability sm) {
+    return ByteBuffer.wrap(encode(sm.split(), 
sm.mergeability()).getBytes(UTF_8));
   }
 
-  public static String encode(Pair<Text,TabletMergeability> split) {
-    return encode(split.getFirst(), split.getSecond());
-  }
-
-  public static Pair<Text,TabletMergeability> decode(ByteBuffer data) {
+  public static SplitMergeability decode(ByteBuffer data) {
     return decode(ByteBufferUtil.toString(data));
   }
 
-  public static Pair<Text,TabletMergeability> decode(String data) {
+  public static SplitMergeability decode(String data) {
     GSonData jData = gson.fromJson(data, GSonData.class);

Review Comment:
   I think you can use gson with Java records directly. I'm not sure you need 
to have a separate GSonData class to facilitate the serialization.



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