Skip to content

Commit

Permalink
[KYUUBI #6359] [REST] Return more fields within session/batch data
Browse files Browse the repository at this point in the history
# 🔍 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

5fb3fb8 [Wang, Fei] fix compile
fc39705 [Wang, Fei] comments
0e7ff00 [Wang, Fei] return app time
bb4b649 [Wang, Fei] dto

Authored-by: Wang, Fei <fwang12@ebay.com>
Signed-off-by: Wang, Fei <fwang12@ebay.com>
  • Loading branch information
turboFei committed May 8, 2024
1 parent 78e104d commit 55f1db3
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public class SessionData {
private String sessionType;
private String kyuubiInstance;
private String engineId;
private String sessionName;
private Integer totalOperations;

public SessionData() {}

Expand All @@ -51,7 +53,9 @@ public SessionData(
String exception,
String sessionType,
String kyuubiInstance,
String engineId) {
String engineId,
String sessionName,
Integer totalOperations) {
this.identifier = identifier;
this.remoteId = remoteId;
this.user = user;
Expand All @@ -64,6 +68,8 @@ public SessionData(
this.sessionType = sessionType;
this.kyuubiInstance = kyuubiInstance;
this.engineId = engineId;
this.sessionName = sessionName;
this.totalOperations = totalOperations;
}

public String getIdentifier() {
Expand Down Expand Up @@ -165,6 +171,22 @@ public void setEngineId(String engineId) {
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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,
Expand Down Expand Up @@ -594,6 +596,7 @@ object JDBCMetadataStore {
"create_time",
"engine_type",
"cluster_manager",
"engine_open_time",
"engine_id",
"engine_name",
"engine_url",
Expand Down

0 comments on commit 55f1db3

Please sign in to comment.