@@ -56,30 +56,36 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
56
56
test(" test basic kyuubi service arguments parser" ) {
57
57
Seq (" get" , " list" , " delete" ).foreach { op =>
58
58
Seq (" server" , " engine" ).foreach { service =>
59
+ val engineUser =
60
+ if (service == " engine" ) {
61
+ Seq (" -u" , user)
62
+ } else {
63
+ Seq .empty[String ]
64
+ }
59
65
val args = Seq (
60
66
op,
61
67
service,
62
68
" --zk-quorum" ,
63
69
zkQuorum,
64
70
" --namespace" ,
65
71
namespace,
66
- " --user" ,
67
- user,
68
72
" --host" ,
69
73
host,
70
74
" --port" ,
71
75
port,
72
76
" --version" ,
73
- KYUUBI_VERSION )
77
+ KYUUBI_VERSION ) ++ engineUser
74
78
val opArgs = new ControlCliArguments (args)
75
79
assert(opArgs.cliConfig.action.toString.equalsIgnoreCase(op))
76
80
assert(opArgs.cliConfig.resource.toString.equalsIgnoreCase(service))
77
81
assert(opArgs.cliConfig.commonOpts.zkQuorum == zkQuorum)
78
82
assert(opArgs.cliConfig.commonOpts.namespace == namespace)
79
- assert(opArgs.cliConfig.engineOpts.user == user)
80
83
assert(opArgs.cliConfig.commonOpts.host == host)
81
84
assert(opArgs.cliConfig.commonOpts.port == port)
82
85
assert(opArgs.cliConfig.commonOpts.version == KYUUBI_VERSION )
86
+ if (service == " engine" ) {
87
+ assert(opArgs.cliConfig.engineOpts.user == user)
88
+ }
83
89
}
84
90
}
85
91
@@ -296,30 +302,36 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
296
302
test(" test use short options" ) {
297
303
Seq (" get" , " list" , " delete" ).foreach { op =>
298
304
Seq (" server" , " engine" ).foreach { service =>
305
+ val engineUser =
306
+ if (service == " engine" ) {
307
+ Seq (" -u" , user)
308
+ } else {
309
+ Seq .empty[String ]
310
+ }
299
311
val args = Seq (
300
312
op,
301
313
service,
302
314
" -zk" ,
303
315
zkQuorum,
304
316
" -n" ,
305
317
namespace,
306
- " -u" ,
307
- user,
308
318
" -s" ,
309
319
host,
310
320
" -p" ,
311
321
port,
312
322
" -v" ,
313
- KYUUBI_VERSION )
323
+ KYUUBI_VERSION ) ++ engineUser
314
324
val opArgs = new ControlCliArguments (args)
315
325
assert(opArgs.cliConfig.action.toString.equalsIgnoreCase(op))
316
326
assert(opArgs.cliConfig.resource.toString.equalsIgnoreCase(service))
317
327
assert(opArgs.cliConfig.commonOpts.zkQuorum == zkQuorum)
318
328
assert(opArgs.cliConfig.commonOpts.namespace == namespace)
319
- assert(opArgs.cliConfig.engineOpts.user == user)
320
329
assert(opArgs.cliConfig.commonOpts.host == host)
321
330
assert(opArgs.cliConfig.commonOpts.port == port)
322
331
assert(opArgs.cliConfig.commonOpts.version == KYUUBI_VERSION )
332
+ if (service == " engine" ) {
333
+ assert(opArgs.cliConfig.engineOpts.user == user)
334
+ }
323
335
}
324
336
}
325
337
@@ -343,7 +355,7 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
343
355
" when the batch is no longer in PENDING state."
344
356
val helpString =
345
357
s """ kyuubi $KYUUBI_VERSION
346
- |Usage: kyuubi-ctl [create|get|delete|list|log|submit] [options] <args>...
358
+ |Usage: kyuubi-ctl [create|get|delete|list|log|submit] [options]
347
359
|
348
360
| -zk, --zk-quorum <value>
349
361
| $zkHelpString
@@ -367,14 +379,14 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
367
379
|Command: create server
368
380
| ${" \t " }Expose Kyuubi server instance to another domain.
369
381
|
370
- |Command: get [batch|server|engine] [options] [<batchId>]
382
+ |Command: get [batch|server|engine] <args>...
371
383
| ${" \t " }Display information about the specified resources.
372
- |Command: get batch
384
+ |Command: get batch [<batchId>]
373
385
| ${" \t " }Get batch by id.
374
386
| <batchId> Batch id.
375
387
|Command: get server
376
388
| ${" \t " }Get Kyuubi server info of domain
377
- |Command: get engine
389
+ |Command: get engine [options]
378
390
| ${" \t " }Get Kyuubi engine info belong to a user.
379
391
| -u, --user <value> The user name this engine belong to.
380
392
| -et, --engine-type <value>
@@ -384,15 +396,15 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
384
396
| -esl, --engine-share-level <value>
385
397
| The engine share level this engine belong to.
386
398
|
387
- |Command: delete [batch|server|engine] [options] [<batchId>]
399
+ |Command: delete [batch|server|engine] <args>...
388
400
| ${" \t " }Delete resources.
389
- |Command: delete batch
401
+ |Command: delete batch [options] [<batchId>]
390
402
| ${" \t " }Close batch session.
391
403
| <batchId> Batch id.
392
404
| --hs2ProxyUser <value> The value of hive.server2.proxy.user config.
393
405
|Command: delete server
394
406
| ${" \t " }Delete the specified service node for a domain
395
- |Command: delete engine
407
+ |Command: delete engine [options]
396
408
| ${" \t " }Delete the specified engine node for user.
397
409
| -u, --user <value> The user name this engine belong to.
398
410
| -et, --engine-type <value>
@@ -402,9 +414,9 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
402
414
| -esl, --engine-share-level <value>
403
415
| The engine share level this engine belong to.
404
416
|
405
- |Command: list [batch|server|engine] [options]
417
+ |Command: list [batch|server|engine]
406
418
| ${" \t " }List information about resources.
407
- |Command: list batch
419
+ |Command: list batch [options]
408
420
| ${" \t " }List batch session info.
409
421
| --batchType <value> Batch type.
410
422
| --batchUser <value> Batch user.
@@ -415,7 +427,7 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
415
427
| --size <value> The max number of records returned in the query.
416
428
|Command: list server
417
429
| ${" \t " }List all the service nodes for a particular domain
418
- |Command: list engine
430
+ |Command: list engine [options]
419
431
| ${" \t " }List all the engine nodes for a user
420
432
| -u, --user <value> The user name this engine belong to.
421
433
| -et, --engine-type <value>
@@ -425,10 +437,10 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
425
437
| -esl, --engine-share-level <value>
426
438
| The engine share level this engine belong to.
427
439
|
428
- |Command: log [batch] [options] [<batchId>]
440
+ |Command: log [batch] [options] <args>...
429
441
| ${" \t " }Print the logs for specified resource.
430
442
| --forward If forward is specified, the ctl will block forever.
431
- |Command: log batch
443
+ |Command: log batch [options] [<batchId>]
432
444
| ${" \t " }Get batch session local log.
433
445
| <batchId> Batch id.
434
446
| --from <value> Specify which record to start from retrieving info.
@@ -437,7 +449,7 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
437
449
|Command: submit [batch] [options]
438
450
| ${" \t " }Combination of create, get and log commands.
439
451
| -f, --filename <value> Filename to use to create the resource
440
- |Command: submit batch
452
+ |Command: submit batch [options]
441
453
| ${" \t " }open batch session and wait for completion.
442
454
| --waitCompletion <value>
443
455
| ${waitBatchCompletionHelpString}
0 commit comments