You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by "cxzl25 (via GitHub)" <gi...@apache.org> on 2023/09/01 08:53:56 UTC

[GitHub] [kyuubi] cxzl25 commented on a diff in pull request #5228: [Improvement] Check config value in numeric or duration range

cxzl25 commented on code in PR #5228:
URL: https://github.com/apache/kyuubi/pull/5228#discussion_r1312764482


##########
kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala:
##########
@@ -342,31 +343,31 @@ object KyuubiConf {
       .doc("How long to wait before retrying to fetch new credentials after a failure.")
       .version("1.4.0")
       .timeConf
-      .checkValue(t => t > 0, "must be positive integer")
+      .checkPositive
       .createWithDefault(Duration.ofMinutes(1).toMillis)
 
   val CREDENTIALS_UPDATE_WAIT_TIMEOUT: ConfigEntry[Long] =
     buildConf("kyuubi.credentials.update.wait.timeout")
       .doc("How long to wait until the credentials are ready.")
       .version("1.5.0")
       .timeConf
-      .checkValue(t => t > 0, "must be positive integer")
+      .checkPositive
       .createWithDefault(Duration.ofMinutes(1).toMillis)
 
   val CREDENTIALS_CHECK_INTERVAL: ConfigEntry[Long] =
     buildConf("kyuubi.credentials.check.interval")
       .doc("The interval to check the expiration of cached <user, CredentialsRef> pairs.")
       .version("1.6.0")
       .timeConf
-      .checkValue(_ > Duration.ofSeconds(3).toMillis, "Minimum 3 seconds")
+      .checkDurationRange(min = Some(Duration.ofSeconds(3)))

Review Comment:
   `_ >` should have different semantics from `checkDurationRange`.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org