lhotari commented on code in PR #23298:
URL: https://github.com/apache/pulsar/pull/23298#discussion_r1758293294


##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/api/MetadataCache.java:
##########
@@ -128,6 +130,24 @@ public interface MetadataCache<T> {
      */
     CompletableFuture<Void> create(String path, T value);
 
+    /**
+     * Create or update the value of the given path in the metadata store 
without version comparison.
+     * <p>
+     * This method is equivalent to
+     * {@link 
org.apache.pulsar.metadata.api.extended.MetadataStoreExtended#put(String, 
byte[], Optional, EnumSet)} or
+     * {@link MetadataStore#put(String, byte[], Optional)} if the metadata 
store does not support this extended API,
+     * with `Optional.empty()` as the 3rd argument. It means if the path does 
not exist, it will be created. If the path
+     * already exists, the new value will override the old value.
+     * </p>
+     * @param path the path of the object in the metadata store
+     * @param value the object to put in the metadata store
+     * @param options the create options if the path does not in the metadata 
store
+     * @return the future that indicates if this operation failed, it could 
fail with
+     *   {@link java.io.IOException} if the value failed to be serialized
+     *   {@link MetadataStoreException} if the metadata store operation failed
+     */
+    CompletableFuture<Void> put(String path, T value, EnumSet<CreateOption> 
options);

Review Comment:
   ```suggestion
       CompletableFuture<Void> put(String path, T value, Set<CreateOption> 
options);
   ```
   It's better to depend on the `Set` interface instead of a particular 
implementation (`EnumSet`)



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