You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by fe...@apache.org on 2022/11/03 04:34:42 UTC

[incubator-kyuubi] branch master updated: [KYUUBI #3746] Support to specify multiple config items with `--conf` in kyuubi command line

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

feiwang 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 95d0a303a [KYUUBI #3746] Support to specify multiple config items with `--conf` in kyuubi command line
95d0a303a is described below

commit 95d0a303aa750817c264bc0b8505911e92fb2622
Author: Fei Wang <fw...@ebay.com>
AuthorDate: Thu Nov 3 12:34:34 2022 +0800

    [KYUUBI #3746] Support to specify multiple config items with `--conf` in kyuubi command line
    
    ### _Why are the changes needed?_
    
    Using `unbounded()` for `--conf`.
    ### _How was this patch tested?_
    - [x] 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.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request
    
    Closes #3746 from turboFei/ctl_config.
    
    Closes #3746
    
    1cc58605c [Fei Wang] use unbounded
    41c0d1a34 [Fei Wang] Revert "Support to multiple config items"
    1d5afb7ea [Fei Wang] Revert "fix style"
    c1d8ff8d1 [Fei Wang] fix style
    67411367c [Fei Wang] Support to multiple config items
    
    Authored-by: Fei Wang <fw...@ebay.com>
    Signed-off-by: Fei Wang <fw...@ebay.com>
---
 .../main/scala/org/apache/kyuubi/ctl/opt/CommonCommandLine.scala    | 1 +
 .../test/scala/org/apache/kyuubi/ctl/ControlCliArgumentsSuite.scala | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/opt/CommonCommandLine.scala b/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/opt/CommonCommandLine.scala
index da855bcd0..e1796e812 100644
--- a/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/opt/CommonCommandLine.scala
+++ b/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/opt/CommonCommandLine.scala
@@ -48,6 +48,7 @@ trait CommonCommandLine {
         .action((v, c) => c.copy(commonOpts = c.commonOpts.copy(hs2ProxyUser = v)))
         .text("The value of hive.server2.proxy.user config."),
       opt[String]("conf")
+        .unbounded()
         .action((v, c) => {
           v.split("=", 2).toSeq match {
             case Seq(k, v) => c.copy(conf = c.conf ++ Map(k -> v))
diff --git a/kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/ControlCliArgumentsSuite.scala b/kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/ControlCliArgumentsSuite.scala
index ccfeef7cd..1b973c0eb 100644
--- a/kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/ControlCliArgumentsSuite.scala
+++ b/kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/ControlCliArgumentsSuite.scala
@@ -500,12 +500,14 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
       "--hostUrl",
       "https://kyuubi.test.com",
       "--conf",
-      s"${CtlConf.CTL_REST_CLIENT_CONNECT_TIMEOUT.key}=5000")
+      s"${CtlConf.CTL_REST_CLIENT_CONNECT_TIMEOUT.key}=5000",
+      "--conf",
+      s"${CtlConf.CTL_REST_CLIENT_REQUEST_MAX_ATTEMPTS.key}=1")
     val opArgs = new ControlCliArguments(args)
     withKyuubiRestClient(opArgs.cliConfig, null, opArgs.command.conf) { kyuubiRestClient =>
       assert(kyuubiRestClient.getConf.getConnectTimeout == 5000)
       assert(kyuubiRestClient.getConf.getSocketTimeout == 120000)
-      assert(kyuubiRestClient.getConf.getMaxAttempts == 3)
+      assert(kyuubiRestClient.getConf.getMaxAttempts == 1)
       assert(kyuubiRestClient.getConf.getAttemptWaitTime == 3000)
     }
   }