merlimat commented on a change in pull request #12896:
URL: https://github.com/apache/pulsar/pull/12896#discussion_r753344157
##########
File path:
pulsar-metadata/src/test/java/org/apache/pulsar/metadata/MetadataCacheTest.java
##########
@@ -331,6 +331,7 @@ public void insertionOutsideCacheWithGenericType(String
provider, Supplier<Strin
});
String key1 = newKey();
+ objCache.get(key1).join();
Review comment:
This is forcing the key to be in the cache, but the test was expressly
trying to check the condition in which it was not.
##########
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:
I wouldn't add a new method in the API that we only are going to be
using internally.
Two solutions:
1. There is already `MetadataCache.getIfCached()`
2. `MetadaCache.refresh()` implementation should take care of it internally.
--
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]