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/07 01:29:22 UTC
[incubator-kyuubi] branch master updated: [KYUUBI #3679][FOLLOWUP] Render namespace details in engine list to make it more user friendly
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 7a64d5576 [KYUUBI #3679][FOLLOWUP] Render namespace details in engine list to make it more user friendly
7a64d5576 is described below
commit 7a64d557666f5c15047e8575459b00d41c776def
Author: Tianlin Liao <ti...@ebay.com>
AuthorDate: Mon Nov 7 09:29:15 2022 +0800
[KYUUBI #3679][FOLLOWUP] Render namespace details in engine list to make it more user friendly
### _Why are the changes needed?_
Before modification:
<img width="903" alt="image" src="https://user-images.githubusercontent.com/21362040/199721384-0efe88a6-6925-46f5-9fe3-211c8b30de7d.png">
After modification:
<img width="803" alt="image" src="https://user-images.githubusercontent.com/21362040/199721427-216fc7fa-f551-436e-9f3d-b973c93670b4.png">
### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
- [x] Add screenshots for manual tests if appropriate
- [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request
Closes #3760 from lightning-L/list-engine.
Closes #3679
20b9903d [Tianlin Liao] [KYUUBI #3679][FOLLOWUP] Render namespace details in engine list to make it more user friendly
Authored-by: Tianlin Liao <ti...@ebay.com>
Signed-off-by: Fei Wang <fw...@ebay.com>
---
.../src/main/scala/org/apache/kyuubi/ctl/util/Render.scala | 12 +++++++++---
.../main/scala/org/apache/kyuubi/ctl/util/Tabulator.scala | 2 +-
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/util/Render.scala b/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/util/Render.scala
index 7c5b0ed28..23f7d4840 100644
--- a/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/util/Render.scala
+++ b/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/util/Render.scala
@@ -35,12 +35,11 @@ private[ctl] object Render {
def renderEngineNodesInfo(engineNodesInfo: Seq[Engine]): String = {
val title = s"Engine Node List (total ${engineNodesInfo.size})"
- val header = Array("Namespace", "Instance", "Version", "Attributes")
+ val header = Array("Namespace", "Instance", "Attributes")
val rows = engineNodesInfo.map { engine =>
Array(
- engine.getNamespace,
+ engine.getNamespace + "\n" + renderEngineNamespaceDetails(engine),
engine.getInstance,
- engine.getVersion,
engine.getAttributes.asScala.map(kv => kv._1 + "=" + kv._2).mkString("\n"))
}.toArray
Tabulator.format(title, header, rows)
@@ -125,4 +124,11 @@ private[ctl] object Render {
}
batchAppInfo.toList
}
+
+ private def renderEngineNamespaceDetails(engine: Engine): String = {
+ val header = Array("EngineType", "ShareLevel", "Subdomain")
+ Tabulator.formatTextTable(
+ header,
+ Array(Array(engine.getEngineType, engine.getSharelevel, engine.getSubdomain)))
+ }
}
diff --git a/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/util/Tabulator.scala b/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/util/Tabulator.scala
index c3792efa9..704436289 100644
--- a/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/util/Tabulator.scala
+++ b/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/util/Tabulator.scala
@@ -33,7 +33,7 @@ private[kyuubi] object Tabulator {
}
}
- private def formatTextTable(header: Array[String], rows: Array[Array[String]]): String = {
+ def formatTextTable(header: Array[String], rows: Array[Array[String]]): String = {
val normalizedRows = rows.map(row => row.map(Option(_).getOrElse("N/A")))
FlipTable.of(header, normalizedRows)
}