diff --git a/dev/dependencyList b/dev/dependencyList index b5b981768..58e024d06 100644 --- a/dev/dependencyList +++ b/dev/dependencyList @@ -132,7 +132,7 @@ okio/1.15.0//okio-1.15.0.jar osgi-resource-locator/1.0.3//osgi-resource-locator-1.0.3.jar paranamer/2.8//paranamer-2.8.jar scala-library/2.12.15//scala-library-2.12.15.jar -scopt_2.12/4.0.1//scopt_2.12-4.0.1.jar +scopt_2.12/4.1.0//scopt_2.12-4.1.0.jar simpleclient/0.14.1//simpleclient-0.14.1.jar simpleclient_common/0.14.1//simpleclient_common-0.14.1.jar simpleclient_dropwizard/0.14.1//simpleclient_dropwizard-0.14.1.jar diff --git a/kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/BatchCliArgumentsSuite.scala b/kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/BatchCliArgumentsSuite.scala index a958a1b6e..47abee364 100644 --- a/kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/BatchCliArgumentsSuite.scala +++ b/kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/BatchCliArgumentsSuite.scala @@ -21,15 +21,18 @@ import org.apache.kyuubi.ctl.util.DateTimeUtils._ class BatchCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit { + val batchYamlFile: String = Thread.currentThread.getContextClassLoader + .getResource("cli/batch.yaml").getFile + test("create/submit batch") { Seq("create", "submit").foreach { op => val args = Seq( op, "batch", "-f", - "src/test/resources/cli/batch.yaml") + batchYamlFile) val opArgs = new ControlCliArguments(args) - assert(opArgs.cliConfig.createOpts.filename == "src/test/resources/cli/batch.yaml") + assert(opArgs.cliConfig.createOpts.filename == batchYamlFile) } } @@ -39,7 +42,7 @@ class BatchCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit { op, "batch", "-f", - "src/test/resources/cli/batch.yaml", + batchYamlFile, "--hostUrl", "https://localhost:8440", "--username", @@ -78,7 +81,7 @@ class BatchCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit { "submit", "batch", "-f", - "src/test/resources/cli/batch.yaml") + batchYamlFile) val opArgs = new ControlCliArguments(args) assert(opArgs.cliConfig.batchOpts.waitCompletion == true) } @@ -88,7 +91,7 @@ class BatchCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit { "submit", "batch", "-f", - "src/test/resources/cli/batch.yaml", + batchYamlFile, "--waitCompletion", "false") val opArgs = new ControlCliArguments(args) 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 dc7f0fbed..1194e14b1 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 @@ -56,6 +56,12 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit { test("test basic kyuubi service arguments parser") { Seq("get", "list", "delete").foreach { op => Seq("server", "engine").foreach { service => + val engineUser = + if (service == "engine") { + Seq("-u", user) + } else { + Seq.empty[String] + } val args = Seq( op, service, @@ -63,23 +69,23 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit { zkQuorum, "--namespace", namespace, - "--user", - user, "--host", host, "--port", port, "--version", - KYUUBI_VERSION) + KYUUBI_VERSION) ++ engineUser val opArgs = new ControlCliArguments(args) assert(opArgs.cliConfig.action.toString.equalsIgnoreCase(op)) assert(opArgs.cliConfig.resource.toString.equalsIgnoreCase(service)) assert(opArgs.cliConfig.commonOpts.zkQuorum == zkQuorum) assert(opArgs.cliConfig.commonOpts.namespace == namespace) - assert(opArgs.cliConfig.engineOpts.user == user) assert(opArgs.cliConfig.commonOpts.host == host) assert(opArgs.cliConfig.commonOpts.port == port) assert(opArgs.cliConfig.commonOpts.version == KYUUBI_VERSION) + if (service == "engine") { + assert(opArgs.cliConfig.engineOpts.user == user) + } } } @@ -296,6 +302,12 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit { test("test use short options") { Seq("get", "list", "delete").foreach { op => Seq("server", "engine").foreach { service => + val engineUser = + if (service == "engine") { + Seq("-u", user) + } else { + Seq.empty[String] + } val args = Seq( op, service, @@ -303,23 +315,23 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit { zkQuorum, "-n", namespace, - "-u", - user, "-s", host, "-p", port, "-v", - KYUUBI_VERSION) + KYUUBI_VERSION) ++ engineUser val opArgs = new ControlCliArguments(args) assert(opArgs.cliConfig.action.toString.equalsIgnoreCase(op)) assert(opArgs.cliConfig.resource.toString.equalsIgnoreCase(service)) assert(opArgs.cliConfig.commonOpts.zkQuorum == zkQuorum) assert(opArgs.cliConfig.commonOpts.namespace == namespace) - assert(opArgs.cliConfig.engineOpts.user == user) assert(opArgs.cliConfig.commonOpts.host == host) assert(opArgs.cliConfig.commonOpts.port == port) assert(opArgs.cliConfig.commonOpts.version == KYUUBI_VERSION) + if (service == "engine") { + assert(opArgs.cliConfig.engineOpts.user == user) + } } } @@ -343,7 +355,7 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit { "when the batch is no longer in PENDING state." val helpString = s"""kyuubi $KYUUBI_VERSION - |Usage: kyuubi-ctl [create|get|delete|list|log|submit] [options] ... + |Usage: kyuubi-ctl [create|get|delete|list|log|submit] [options] | | -zk, --zk-quorum | $zkHelpString @@ -367,14 +379,14 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit { |Command: create server |${"\t"}Expose Kyuubi server instance to another domain. | - |Command: get [batch|server|engine] [options] [] + |Command: get [batch|server|engine] ... |${"\t"}Display information about the specified resources. - |Command: get batch + |Command: get batch [] |${"\t"}Get batch by id. | Batch id. |Command: get server |${"\t"}Get Kyuubi server info of domain - |Command: get engine + |Command: get engine [options] |${"\t"}Get Kyuubi engine info belong to a user. | -u, --user The user name this engine belong to. | -et, --engine-type @@ -384,15 +396,15 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit { | -esl, --engine-share-level | The engine share level this engine belong to. | - |Command: delete [batch|server|engine] [options] [] + |Command: delete [batch|server|engine] ... |${"\t"}Delete resources. - |Command: delete batch + |Command: delete batch [options] [] |${"\t"}Close batch session. | Batch id. | --hs2ProxyUser The value of hive.server2.proxy.user config. |Command: delete server |${"\t"}Delete the specified service node for a domain - |Command: delete engine + |Command: delete engine [options] |${"\t"}Delete the specified engine node for user. | -u, --user The user name this engine belong to. | -et, --engine-type @@ -402,9 +414,9 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit { | -esl, --engine-share-level | The engine share level this engine belong to. | - |Command: list [batch|server|engine] [options] + |Command: list [batch|server|engine] |${"\t"}List information about resources. - |Command: list batch + |Command: list batch [options] |${"\t"}List batch session info. | --batchType Batch type. | --batchUser Batch user. @@ -415,7 +427,7 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit { | --size The max number of records returned in the query. |Command: list server |${"\t"}List all the service nodes for a particular domain - |Command: list engine + |Command: list engine [options] |${"\t"}List all the engine nodes for a user | -u, --user The user name this engine belong to. | -et, --engine-type @@ -425,10 +437,10 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit { | -esl, --engine-share-level | The engine share level this engine belong to. | - |Command: log [batch] [options] [] + |Command: log [batch] [options] ... |${"\t"}Print the logs for specified resource. | --forward If forward is specified, the ctl will block forever. - |Command: log batch + |Command: log batch [options] [] |${"\t"}Get batch session local log. | Batch id. | --from Specify which record to start from retrieving info. @@ -437,7 +449,7 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit { |Command: submit [batch] [options] |${"\t"}Combination of create, get and log commands. | -f, --filename Filename to use to create the resource - |Command: submit batch + |Command: submit batch [options] |${"\t"}open batch session and wait for completion. | --waitCompletion | ${waitBatchCompletionHelpString} diff --git a/pom.xml b/pom.xml index a3d0cfba2..1bd1503ae 100644 --- a/pom.xml +++ b/pom.xml @@ -158,7 +158,7 @@ 3.2.9.0 3.2.9 3.2.9.0 - 4.0.1 + 4.1.0 1.7.35 1.30