[KYUUBI #6359] [REST] Return more fields within session/batch data
# 🔍 Description ## Issue References 🔗 This pull request fixes # ## Describe Your Solution 🔧 Return `sessionName` and `totalOperations` within `SessionData`. Return `appStartTime` with list batches. ## Types of changes 🔖 - [ ] Bugfix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Test Plan 🧪 #### Behavior Without This Pull Request ⚰️ #### Behavior With This Pull Request 🎉 #### Related Unit Tests --- # Checklist 📝 - [x] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html) **Be nice. Be informative.** Closes #6359 from turboFei/total_op. Closes #6359 5fb3fb8e4 [Wang, Fei] fix compile fc3970595 [Wang, Fei] comments 0e7ff009e [Wang, Fei] return app time bb4b64902 [Wang, Fei] dto Authored-by: Wang, Fei <fwang12@ebay.com> Signed-off-by: Wang, Fei <fwang12@ebay.com>
This commit is contained in:
parent
78e104d18b
commit
55f1db3c14
@ -36,6 +36,8 @@ public class SessionData {
|
||||
private String sessionType;
|
||||
private String kyuubiInstance;
|
||||
private String engineId;
|
||||
private String sessionName;
|
||||
private Integer totalOperations;
|
||||
|
||||
public SessionData() {}
|
||||
|
||||
@ -51,7 +53,9 @@ public class SessionData {
|
||||
String exception,
|
||||
String sessionType,
|
||||
String kyuubiInstance,
|
||||
String engineId) {
|
||||
String engineId,
|
||||
String sessionName,
|
||||
Integer totalOperations) {
|
||||
this.identifier = identifier;
|
||||
this.remoteId = remoteId;
|
||||
this.user = user;
|
||||
@ -64,6 +68,8 @@ public class SessionData {
|
||||
this.sessionType = sessionType;
|
||||
this.kyuubiInstance = kyuubiInstance;
|
||||
this.engineId = engineId;
|
||||
this.sessionName = sessionName;
|
||||
this.totalOperations = totalOperations;
|
||||
}
|
||||
|
||||
public String getIdentifier() {
|
||||
@ -165,6 +171,22 @@ public class SessionData {
|
||||
this.engineId = engineId;
|
||||
}
|
||||
|
||||
public String getSessionName() {
|
||||
return sessionName;
|
||||
}
|
||||
|
||||
public void setSessionName(String sessionName) {
|
||||
this.sessionName = sessionName;
|
||||
}
|
||||
|
||||
public Integer getTotalOperations() {
|
||||
return totalOperations;
|
||||
}
|
||||
|
||||
public void setTotalOperations(Integer totalOperations) {
|
||||
this.totalOperations = totalOperations;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
|
||||
@ -64,7 +64,9 @@ object ApiUtils extends Logging {
|
||||
sessionEvent.flatMap(_.exception).map(Utils.prettyPrint).getOrElse(""),
|
||||
session.sessionType.toString,
|
||||
session.connectionUrl,
|
||||
sessionEvent.map(_.engineId).getOrElse(""))
|
||||
sessionEvent.map(_.engineId).getOrElse(""),
|
||||
session.name.getOrElse(""),
|
||||
sessionEvent.map(_.totalOperations).getOrElse(0): Int)
|
||||
}
|
||||
|
||||
private def operationProgress(operation: KyuubiOperation): OperationProgress = {
|
||||
|
||||
@ -432,6 +432,7 @@ class JDBCMetadataStore(conf: KyuubiConf) extends MetadataStore with Logging {
|
||||
val createTime = resultSet.getLong("create_time")
|
||||
val engineType = resultSet.getString("engine_type")
|
||||
val clusterManager = Option(resultSet.getString("cluster_manager"))
|
||||
val engineOpenTime = resultSet.getLong("engine_open_time")
|
||||
val engineId = resultSet.getString("engine_id")
|
||||
val engineName = resultSet.getString("engine_name")
|
||||
val engineUrl = resultSet.getString("engine_url")
|
||||
@ -456,6 +457,7 @@ class JDBCMetadataStore(conf: KyuubiConf) extends MetadataStore with Logging {
|
||||
createTime = createTime,
|
||||
engineType = engineType,
|
||||
clusterManager = clusterManager,
|
||||
engineOpenTime = engineOpenTime,
|
||||
engineId = engineId,
|
||||
engineName = engineName,
|
||||
engineUrl = engineUrl,
|
||||
@ -594,6 +596,7 @@ object JDBCMetadataStore {
|
||||
"create_time",
|
||||
"engine_type",
|
||||
"cluster_manager",
|
||||
"engine_open_time",
|
||||
"engine_id",
|
||||
"engine_name",
|
||||
"engine_url",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user