dragosvictor commented on code in PR #21816: URL: https://github.com/apache/pulsar/pull/21816#discussion_r1438053056
########## managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorContainer.java: ########## @@ -204,6 +281,24 @@ public ManagedCursor getSlowestReader() { } } + /** + * @return Returns the CursorInfo for the cursor with the oldest position, + * or null if there aren't any tracked cursors + */ + public CursorInfo getCursorWithOldestPosition() { + long stamp = rwLock.readLock(); + try { + if (heap.isEmpty()) { + return null; + } else { + Item item = heap.get(0); Review Comment: @dao-jun You're right, didn't notice it. Thanks for pointing it out! -- 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-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org