Jason918 commented on a change in pull request #12896:
URL: https://github.com/apache/pulsar/pull/12896#discussion_r753619915
##########
File path:
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/api/MetadataCache.java
##########
@@ -155,4 +155,12 @@
* @param path the path of the object in the metadata store
*/
void refresh(String path);
+
+
+ /**
+ * Check if the value of this path is already in cache.
+ * @param path the path of the object in the metadata store
+ * @return true if the path exists.
+ */
+ boolean existsInCache(String path);
Review comment:
The only reason I am not using `MetadataCache.getIfCached()` is it would
block and wait for current load future is completed.
I am taking solution 2. It would not be "refresh" if we have not already
loaded the path object, right?
Although, it may change some old behaviors.
--
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]