This is an automated email from the ASF dual-hosted git repository.

ulyssesyou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 6b9a15a  [KYUUBI #1428] Add metrics reporters conf value check
6b9a15a is described below

commit 6b9a15a89a5ad67d66dfb967de24d62601aef980
Author: zhenjiaguo <[email protected]>
AuthorDate: Mon Nov 22 09:37:34 2021 +0800

    [KYUUBI #1428] Add metrics reporters conf value check
    
    <!--
    Thanks for sending a pull request!
    
    Here are some tips for you:
      1. If this is your first time, please read our contributor guidelines: 
https://kyuubi.readthedocs.io/en/latest/community/contributions.html
      2. If the PR is related to an issue in 
https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your 
PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
      3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., 
'[WIP][KYUUBI #XXXX] Your PR title ...'.
    -->
    
    ### _Why are the changes needed?_
    <!--
    Please clarify why the changes are needed. For instance,
      1. If you add a feature, you can talk about the use case of it.
      2. If you fix a bug, you can clarify why it is a bug.
    -->
    Configuration metrics reporter need to check that match kyuubi provided 
reporter.
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including 
negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [x] [Run 
test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests)
 locally before make a pull request
    
    Closes #1428 from zhenjiaguo/metrics_reporters_check_value.
    
    Closes #1428
    
    11a6f9a1 [zhenjiaguo] add metrics reporters check value
    
    Authored-by: zhenjiaguo <[email protected]>
    Signed-off-by: ulysses-you <[email protected]>
---
 .../src/main/scala/org/apache/kyuubi/metrics/MetricsConf.scala          | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/MetricsConf.scala 
b/kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/MetricsConf.scala
index 5e1112d..89c20ba 100644
--- a/kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/MetricsConf.scala
+++ b/kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/MetricsConf.scala
@@ -46,6 +46,8 @@ object MetricsConf {
     .stringConf
     .transform(_.toUpperCase())
     .toSequence()
+    .checkValue(_.forall(ReporterType.values.map(_.toString).contains),
+      s"the reporter type should be one or more of 
${ReporterType.values.mkString(",")}")
     .createWithDefault(Seq(JSON.toString))
 
   val METRICS_CONSOLE_INTERVAL: ConfigEntry[Long] = 
buildConf("metrics.console.interval")

Reply via email to