orenccl commented on code in PR #5995:
URL: https://github.com/apache/gravitino/pull/5995#discussion_r1897808881


##########
core/src/main/java/org/apache/gravitino/credential/config/CredentialConfig.java:
##########
@@ -21,22 +21,68 @@
 
 import com.google.common.collect.ImmutableMap;
 import java.util.Map;
+import org.apache.gravitino.Config;
+import org.apache.gravitino.config.ConfigBuilder;
+import org.apache.gravitino.config.ConfigConstants;
+import org.apache.gravitino.config.ConfigEntry;
 import org.apache.gravitino.connector.PropertyEntry;
 import org.apache.gravitino.credential.CredentialConstants;
 
-public class CredentialConfig {
+public class CredentialConfig extends Config {
+
+  private static final long DEFAULT_CREDENTIAL_CACHE_MAX_SIZE = 10_000L;
+  private static final long DEFAULT_CREDENTIAL_CACHE_EXPIRE_IN_SECS = 300;
 
   public static final Map<String, PropertyEntry<?>> 
CREDENTIAL_PROPERTY_ENTRIES =
       new ImmutableMap.Builder<String, PropertyEntry<?>>()
           .put(
               CredentialConstants.CREDENTIAL_PROVIDERS,
-              PropertyEntry.booleanPropertyEntry(
+              PropertyEntry.stringPropertyEntry(
                   CredentialConstants.CREDENTIAL_PROVIDERS,
                   "Credential providers for the Gravitino catalog, schema, 
fileset, table, etc.",
                   false /* required */,
                   false /* immutable */,
                   null /* default value */,
                   false /* hidden */,
                   false /* reserved */))
+          .put(
+              CredentialConstants.CREDENTIAL_CACHE_EXPIRE_IN_SECS,
+              PropertyEntry.longPropertyEntry(
+                  CredentialConstants.CREDENTIAL_CACHE_EXPIRE_IN_SECS,
+                  "Max cache time for the credential.",
+                  false /* required */,
+                  false /* immutable */,
+                  DEFAULT_CREDENTIAL_CACHE_EXPIRE_IN_SECS /* default value */,
+                  false /* hidden */,
+                  false /* reserved */))
+          .put(
+              CredentialConstants.CREDENTIAL_CACHE_MAX_SIZE,
+              PropertyEntry.longPropertyEntry(
+                  CredentialConstants.CREDENTIAL_CACHE_MAX_SIZE,
+                  "Max size for the credential cache.",
+                  false /* required */,
+                  false /* immutable */,
+                  DEFAULT_CREDENTIAL_CACHE_MAX_SIZE /* default value */,
+                  false /* hidden */,
+                  false /* reserved */))
           .build();
+
+  public static final ConfigEntry<Long> CREDENTIAL_CACHE_EXPIRE_IN_SECS =
+      new ConfigBuilder(CredentialConstants.CREDENTIAL_CACHE_EXPIRE_IN_SECS)
+          .doc("Max expire time for the credential cache.")
+          .version(ConfigConstants.VERSION_0_8_0)
+          .longConf()
+          .createWithDefault(DEFAULT_CREDENTIAL_CACHE_EXPIRE_IN_SECS);
+
+  public static final ConfigEntry<Long> CREDENTIAL_CACHE_MAZ_SIZE =

Review Comment:
   Should be MAX?



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