coderzc commented on code in PR #17164:
URL: https://github.com/apache/pulsar/pull/17164#discussion_r952211081


##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedCursor.java:
##########
@@ -86,14 +86,20 @@ enum IndividualDeletedEntries {
      */
     Map<String, String> getCursorProperties();
 
-     /**
-      * Updates the properties.
-      * @param cursorProperties
-      * @return a handle to the result of the operation
-      */
-     default CompletableFuture<Void> setCursorProperties(Map<String, String> 
cursorProperties) {
-         return CompletableFuture.completedFuture(null);
-     }
+    /**
+     * Add a property associated with the cursor.
+     */
+    void putCursorProperty(String key, String value);
+
+    /**
+     * Set all properties associated with the cursor, internal properties are 
still preserved.
+     */
+    void setAllCursorProperties(Map<String, String> properties);
+
+    /**
+     * Remove a property associated with the cursor.
+     */
+    void removeCursorProperty(String key);
 

Review Comment:
   > Instead of modifying the interface, it would be better to fix the issue in 
the existing method, `CompletableFuture<Void> setCursorProperties(Map<String, 
String> cursorProperties)`.
   > 
   > Adding a new "blocking API" instead of using an asynchronous method will 
cause issues.
   
   If keep using an asynchronous method will not ensure data consistency when 
the concurrent modification.



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