Skip to content

Commit

Permalink
[REST] Return remote session id and remote operation id
Browse files Browse the repository at this point in the history
  • Loading branch information
turboFei committed Nov 15, 2023
1 parent 0210d54 commit 26a0b2c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

public class OperationData {
private String identifier;
private String remoteId;
private String statement;
private String state;
private Long createTime;
Expand All @@ -41,6 +42,7 @@ public OperationData() {}

public OperationData(
String identifier,
String remoteId,
String statement,
String state,
Long createTime,
Expand All @@ -53,6 +55,7 @@ public OperationData(
String kyuubiInstance,
Map<String, String> metrics) {
this.identifier = identifier;
this.remoteId = remoteId;
this.statement = statement;
this.state = state;
this.createTime = createTime;
Expand All @@ -74,6 +77,14 @@ public void setIdentifier(String identifier) {
this.identifier = identifier;
}

public String getRemoteId() {
return remoteId;
}

public void setRemoteId(String remoteId) {
this.remoteId = remoteId;
}

public String getStatement() {
return statement;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

public class SessionData {
private String identifier;
private String remoteSessionId;
private String user;
private String ipAddr;
private Map<String, String> conf;
Expand All @@ -40,6 +41,7 @@ public SessionData() {}

public SessionData(
String identifier,
String remoteSessionId,
String user,
String ipAddr,
Map<String, String> conf,
Expand All @@ -51,6 +53,7 @@ public SessionData(
String kyuubiInstance,
String engineId) {
this.identifier = identifier;
this.remoteSessionId = remoteSessionId;
this.user = user;
this.ipAddr = ipAddr;
this.conf = conf;
Expand All @@ -71,6 +74,14 @@ public void setIdentifier(String identifier) {
this.identifier = identifier;
}

public String getRemoteSessionId() {
return remoteSessionId;
}

public void setRemoteSessionId(String remoteSessionId) {
this.remoteSessionId = remoteSessionId;
}

public String getUser() {
return user;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ object ApiUtils extends Logging {
val sessionEvent = session.getSessionEvent
new SessionData(
session.handle.identifier.toString,
sessionEvent.map(_.remoteSessionId).getOrElse(""),
session.user,
session.ipAddress,
session.conf.asJava,
Expand All @@ -48,6 +49,7 @@ object ApiUtils extends Logging {
val opEvent = KyuubiOperationEvent(operation)
new OperationData(
opEvent.statementId,
opEvent.remoteId,
opEvent.statement,
opEvent.state,
opEvent.createTime,
Expand Down

0 comments on commit 26a0b2c

Please sign in to comment.