jerryshao commented on code in PR #5134:
URL: https://github.com/apache/gravitino/pull/5134#discussion_r1802879937


##########
iceberg/iceberg-common/src/main/java/org/apache/gravitino/iceberg/common/ops/IcebergCatalogWrapper.java:
##########
@@ -303,18 +348,38 @@ private void closePostgreSQLCatalogResource() {
   }
 
   // Some io and security configuration should pass to Iceberg REST client
-  private LoadTableResponse injectTableConfig(Supplier<LoadTableResponse> 
supplier) {
+  private LoadTableResponse injectTableConfig(
+      Supplier<LoadTableResponse> supplier, Function<String, Map<String, 
String>> configInjector) {
     LoadTableResponse loadTableResponse = supplier.get();
     return LoadTableResponse.builder()
         .withTableMetadata(loadTableResponse.tableMetadata())
-        .addAllConfig(getCatalogConfigToClient())
+        
.addAllConfig(configInjector.apply(loadTableResponse.tableMetadata().location()))
         .build();
   }
 
-  private Map<String, String> getCatalogConfigToClient() {
+  private Map<String, String> getCatalogConfigToClient(String location) {
     return catalogConfigToClients;
   }
 
+  private Map<String, String> vendCredentials(String location) {
+    // ifPresentOrElse is not supported in Java8
+    if (credentialProvider.isPresent()) {

Review Comment:
   You can change to simplify your code here:
   
   ```java
   
   if (!xx.isPresent) {
     throw new XXXException();
   }
   
   ....
   }



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