merlimat commented on a change in pull request #1219: Xzy initialize subscription config URL: https://github.com/apache/incubator-pulsar/pull/1219#discussion_r167655263
########## File path: managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedger.java ########## @@ -138,6 +138,20 @@ */ public ManagedCursor openCursor(String name) throws InterruptedException, ManagedLedgerException; + /** + * Open a ManagedCursor in this ManagedLedger. + * <p> + * If the cursors doesn't exist, a new one will be created and its position will be at the end of the ManagedLedger. + * + * @param name + * the name associated with the ManagedCursor + * @param initializeOnLatest + * the flag tell the method wthether it should intialize the cursor at latest position or not. + * @return the ManagedCursor + * @throws ManagedLedgerException + */ + public ManagedCursor openCursor(String name, boolean initializeOnLatest) throws InterruptedException, ManagedLedgerException; Review comment: rather than using a boolean I'd prefer having an enum here. Reading code with: ```java managedLedger.openCursor("name", true); ``` doesn't convey what the `true` means. ```java managedLedger.openCursor("name", CursorPosition.InitializeOnLatest); managedLedger.openCursor("name", CursorPosition.InitializeOnEarliest); ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services