You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/08/23 04:29:27 UTC
[GitHub] [pulsar] lhotari commented on a diff in pull request #17164: [improve][broker] Make cursor properties support modify single value concurrently.
lhotari commented on code in PR #17164:
URL: https://github.com/apache/pulsar/pull/17164#discussion_r952138443
##########
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.
--
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-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org