mattisonchao commented on code in PR #17712:
URL: https://github.com/apache/pulsar/pull/17712#discussion_r1015028310
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java:
##########
@@ -371,7 +373,28 @@ public void operationFailed(MetaStoreException e) {
@Override
public CompletableFuture<Void> setCursorProperties(Map<String, String>
cursorProperties) {
- return computeCursorProperties(lastRead -> cursorProperties);
+ Map<String, String> newProperties =
+ cursorProperties == null ? new HashMap<>() : new
HashMap<>(cursorProperties);
+
+ // Prohibit setting of internal properties
+ Set<String> keys = newProperties.keySet();
+ for (String key : keys) {
+ if (key.startsWith(CURSOR_INTERNAL_PROPERTY_PREFIX)) {
+ throw new IllegalArgumentException(
Review Comment:
I think returning failed `CompletableFuture` will be more make sense for the
caller.
--
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]