RobertIndie commented on a change in pull request #12872:
URL: https://github.com/apache/pulsar/pull/12872#discussion_r757998632



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ResetCursorData.java
##########
@@ -43,6 +43,21 @@ public ResetCursorData(long ledgerId, long entryId, boolean 
isExcluded) {
         this.isExcluded = isExcluded;
     }
 
+    // Private constructor used only for json deserialization
+    private ResetCursorData(String position) {
+        if ("latest".equals(position)) {
+            this.ledgerId = Long.MAX_VALUE;
+            this.entryId = Long.MAX_VALUE;
+        } else if ("earliest".equals(position)) {
+            this.ledgerId = -1;
+            this.entryId = -1;
+        } else {
+            throw new IllegalArgumentException(

Review comment:
       Just like the MessageIdImpl, the encoding format like 
`{"ledgerId":9223372036854775807,"entryId":9223372036854775807,"partitionIndex":-1}
   ` is not implemented through this constructor, but directly through 
deserialization of the json object. This constructor is only for the case of 
constant values.
   
   




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