lhotari commented on code in PR #17273:
URL: https://github.com/apache/pulsar/pull/17273#discussion_r956751759


##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorContainer.java:
##########
@@ -45,33 +45,48 @@
  */
 public class ManagedCursorContainer implements Iterable<ManagedCursor> {
 
+    private final OrderingType orderingType;
+    private final OrderingFilter orderingFilter;
+
     private static class Item {
         final ManagedCursor cursor;
         PositionImpl position;
         int idx;
 
-        Item(ManagedCursor cursor, int idx) {
+        Item(ManagedCursor cursor, PositionImpl position, int idx) {
             this.cursor = cursor;
-            this.position = (PositionImpl) cursor.getMarkDeletedPosition();
+            this.position = position;
             this.idx = idx;
         }
     }
 
-    public enum CursorType {
-        DurableCursor,
-        NonDurableCursor,
-        ALL
+    private enum OrderingType {
+        MARKDELETED_POSITION,
+        READ_POSITION
+    }

Review Comment:
   I updated the Javadoc and ended up simplifying ManagedCursorContainer. I 
removed that OrderingType and OrderingFilter completely and instead modified 
the add method to explicitly pass the position which is used for ordering. If 
this is null, the cursor won't be tracked in the heap and ordered. This feels 
more consistent with the "cursorUpdated" method which also takes a cursor and 
position parameters. 



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