roryqi commented on code in PR #11155:
URL: https://github.com/apache/gravitino/pull/11155#discussion_r3270924041


##########
core/src/main/java/org/apache/gravitino/credential/CredentialCache.java:
##########
@@ -87,8 +88,11 @@ public void initialize(Map<String, String> 
catalogProperties) {
             .build();
   }
 
-  public Credential getCredential(T cacheKey, Function<T, Credential> 
credentialSupplier) {
-    return credentialCache.get(cacheKey, key -> 
credentialSupplier.apply(cacheKey));
+  public Optional<Credential> getCredential(
+      T cacheKey, Function<T, Optional<Credential>> credentialSupplier) {
+    Credential credential =
+        credentialCache.get(cacheKey, key -> 
credentialSupplier.apply(cacheKey).orElse(null));
+    return Optional.ofNullable(credential);

Review Comment:
   unacceptable. It will breaks the atomic.



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