You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/11/26 22:38:24 UTC

[GitHub] [pulsar] eolivelli commented on a change in pull request #12872: [Broker] Support create subscription by specifying the earliest or latest position.

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



##########
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:
       It looks like we are not supporting the same encoding of MessageIdImpl and you are only supporting the two constant values.
   
   Am I missing something?




-- 
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: commits-unsubscribe@pulsar.apache.org

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