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/kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 35aa20240 [KYUUBI #4890] Return operation metrics in OperationData and 
fix typo
35aa20240 is described below

commit 35aa202406175619492627e3afd15c9a10c9f94e
Author: fwang12 <[email protected]>
AuthorDate: Fri May 26 18:18:16 2023 +0800

    [KYUUBI #4890] Return operation metrics in OperationData and fix typo
    
    ### _Why are the changes needed?_
    
    Return operation metrics and fix typo.
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including 
negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [x] [Run 
test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests)
 locally before make a pull request
    
    Closes #4890 from turboFei/op_data_metrics.
    
    Closes #4890
    
    ef2ed36eb [fwang12] return metrics and fix bug
    
    Authored-by: fwang12 <[email protected]>
    Signed-off-by: fwang12 <[email protected]>
---
 .../apache/kyuubi/client/api/v1/dto/OperationData.java   | 16 ++++++++++++++--
 .../scala/org/apache/kyuubi/server/api/ApiUtils.scala    |  3 ++-
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git 
a/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/api/v1/dto/OperationData.java
 
b/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/api/v1/dto/OperationData.java
index 1b99bb2c6..8b1f7656e 100644
--- 
a/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/api/v1/dto/OperationData.java
+++ 
b/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/api/v1/dto/OperationData.java
@@ -17,6 +17,7 @@
 
 package org.apache.kyuubi.client.api.v1.dto;
 
+import java.util.Map;
 import java.util.Objects;
 import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
@@ -33,6 +34,7 @@ public class OperationData {
   private String sessionUser;
   private String sessionType;
   private String kyuubiInstance;
+  private Map<String, String> metrics;
 
   public OperationData() {}
 
@@ -47,7 +49,8 @@ public class OperationData {
       String sessionId,
       String sessionUser,
       String sessionType,
-      String kyuubiInstance) {
+      String kyuubiInstance,
+      Map<String, String> metrics) {
     this.identifier = identifier;
     this.statement = statement;
     this.state = state;
@@ -59,6 +62,7 @@ public class OperationData {
     this.sessionUser = sessionUser;
     this.sessionType = sessionType;
     this.kyuubiInstance = kyuubiInstance;
+    this.metrics = metrics;
   }
 
   public String getIdentifier() {
@@ -149,11 +153,19 @@ public class OperationData {
     this.kyuubiInstance = kyuubiInstance;
   }
 
+  public Map<String, String> getMetrics() {
+    return metrics;
+  }
+
+  public void setMetrics(Map<String, String> metrics) {
+    this.metrics = metrics;
+  }
+
   @Override
   public boolean equals(Object o) {
     if (this == o) return true;
     if (o == null || getClass() != o.getClass()) return false;
-    SessionData that = (SessionData) o;
+    OperationData that = (OperationData) o;
     return Objects.equals(getIdentifier(), that.getIdentifier());
   }
 
diff --git 
a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/ApiUtils.scala 
b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/ApiUtils.scala
index 1f2cb309b..6b01def5c 100644
--- a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/ApiUtils.scala
+++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/ApiUtils.scala
@@ -57,7 +57,8 @@ object ApiUtils {
       opEvent.sessionId,
       opEvent.sessionUser,
       opEvent.sessionType,
-      operation.getSession.asInstanceOf[KyuubiSession].connectionUrl)
+      operation.getSession.asInstanceOf[KyuubiSession].connectionUrl,
+      operation.metrics.asJava)
   }
 
   def serverData(nodeInfo: ServiceNodeInfo): ServerData = {

Reply via email to