BewareMyPower commented on code in PR #24186:
URL: https://github.com/apache/pulsar/pull/24186#discussion_r2049871560
##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/tableview/impl/MetadataStoreTableViewImpl.java:
##########
@@ -299,14 +299,23 @@ public T get(String key) {
public CompletableFuture<Void> put(String key, T value) {
String path = getPath(key);
- return cache.readModifyUpdateOrCreate(path, (old) -> {
- if (conflictResolver.test(old.orElse(null), value)) {
- return value;
- } else {
- throw new ConflictException(
- String.format("Failed to update from old:%s to
value:%s", old, value));
- }
- }).thenCompose(__ -> doHandleNotification(path)); // immediately
notify local tableview
+ return cache.readModifyUpdateOrCreateOnce(path, (old) -> {
+ if (conflictResolver.test(old.orElse(null), value)) {
+ return value;
+ } else {
+ throw new ConflictException(
+ String.format("Failed to update from old:%s to
value:%s", old, value));
+ }
+ })
+ .thenCompose(__ -> doHandleNotification(path)) // immediately
notify local tableview
Review Comment:
These indent changes seems not necessary.
--
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]