BewareMyPower commented on code in PR #24961:
URL: https://github.com/apache/pulsar/pull/24961#discussion_r2509332006


##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedger.java:
##########
@@ -764,6 +766,27 @@ default ManagedLedgerAttributes 
getManagedLedgerAttributes() {
 
     void asyncReadEntry(Position position, AsyncCallbacks.ReadEntryCallback 
callback, Object ctx);
 
+    /**
+     * Async read entries.
+     * Notice: You MUST have a Durable cursor outside of the managed ledger, 
to protect the ledgers from being deleted.
+     *
+     * @param start
+     * @param numberOfEntriesToRead
+     * @param callback
+     * @param ctx
+     */
+    void asyncReadEntries(Position start, long numberOfEntriesToRead, 
AsyncCallbacks.ReadEntriesCallback callback,
+                          Object ctx);
+
+    /**
+     * Async read entries.
+     * Notice: You MUST have a Durable cursor outside of the managed ledger, 
to protect the ledgers from being deleted.
+     *
+     * @param start
+     * @param numberOfEntriesToRead
+     */

Review Comment:
   No document is better than documents that are just a template.
   
   Regarding the ledger deletion, it should not be documented here. There is 
already a document for this: 
https://pulsar.apache.org/docs/next/cookbooks-retention-expiry/



##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedger.java:
##########
@@ -764,6 +766,27 @@ default ManagedLedgerAttributes 
getManagedLedgerAttributes() {
 
     void asyncReadEntry(Position position, AsyncCallbacks.ReadEntryCallback 
callback, Object ctx);
 
+    /**
+     * Async read entries.
+     * Notice: You MUST have a Durable cursor outside of the managed ledger, 
to protect the ledgers from being deleted.
+     *
+     * @param start
+     * @param numberOfEntriesToRead
+     * @param callback
+     * @param ctx
+     */
+    void asyncReadEntries(Position start, long numberOfEntriesToRead, 
AsyncCallbacks.ReadEntriesCallback callback,
+                          Object ctx);

Review Comment:
   No need to add a callback based API



##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedger.java:
##########
@@ -764,6 +766,27 @@ default ManagedLedgerAttributes 
getManagedLedgerAttributes() {
 
     void asyncReadEntry(Position position, AsyncCallbacks.ReadEntryCallback 
callback, Object ctx);
 
+    /**
+     * Async read entries.
+     * Notice: You MUST have a Durable cursor outside of the managed ledger, 
to protect the ledgers from being deleted.
+     *
+     * @param start
+     * @param numberOfEntriesToRead
+     * @param callback
+     * @param ctx
+     */
+    void asyncReadEntries(Position start, long numberOfEntriesToRead, 
AsyncCallbacks.ReadEntriesCallback callback,
+                          Object ctx);
+
+    /**
+     * Async read entries.
+     * Notice: You MUST have a Durable cursor outside of the managed ledger, 
to protect the ledgers from being deleted.
+     *
+     * @param start
+     * @param numberOfEntriesToRead
+     */
+    CompletableFuture<List<Entry>> asyncReadEntries(Position start, long 
numberOfEntriesToRead);

Review Comment:
   `numberOfEntriesToRead` should be `int`.
   
   Additionally, this method does not have `maxSizeBytes` limit like 
`ManagedCursor#asyncReadEntries`



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