tengqm commented on code in PR #5753:
URL: https://github.com/apache/gravitino/pull/5753#discussion_r1872437640


##########
api/src/main/java/org/apache/gravitino/credential/GCSTokenCredential.java:
##########
@@ -33,35 +33,48 @@ public class GCSTokenCredential implements Credential {
   /** GCS credential property, token name. */
   public static final String GCS_TOKEN_NAME = "token";
 
-  private final String token;
-  private final long expireMs;
+  private String token;
+  private long expireTimeInMs;
 
   /**
    * @param token The GCS token.
-   * @param expireMs The GCS token expire time at ms.
+   * @param expireTimeInMs The GCS token expire time at ms.
    */
-  public GCSTokenCredential(String token, long expireMs) {
-    Preconditions.checkArgument(
-        StringUtils.isNotBlank(token), "GCS session token should not be null");
+  public GCSTokenCredential(String token, long expireTimeInMs) {
+    validate(token, expireTimeInMs);
     this.token = token;
-    this.expireMs = expireMs;
+    this.expireTimeInMs = expireTimeInMs;
   }
 
+  /**
+   * This is the constructor that is used by credential factory to create an 
instance of credential
+   * according to the credential information.
+   */
+  public GCSTokenCredential() {}
+
   @Override
   public String credentialType() {
     return GCS_TOKEN_CREDENTIAL_TYPE;
   }
 
   @Override
   public long expireTimeInMs() {
-    return expireMs;
+    return expireTimeInMs;
   }
 
   @Override
   public Map<String, String> credentialInfo() {
     return (new ImmutableMap.Builder<String, String>()).put(GCS_TOKEN_NAME, 
token).build();
   }
 
+  @Override
+  public void initWithCredentialInfo(Map<String, String> credentialInfo, long 
expireTimeInMs) {

Review Comment:
   Wondering if a simple name like `initialize` is more straightforward.



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