You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by hv...@apache.org on 2023/08/17 15:49:43 UTC

[spark] branch master updated: [SPARK-44849] Expose SparkConnectExecutionManager.listActiveExecutions

This is an automated email from the ASF dual-hosted git repository.

hvanhovell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 047b2247879 [SPARK-44849] Expose SparkConnectExecutionManager.listActiveExecutions
047b2247879 is described below

commit 047b2247879cc3f5fd9b78366a73edbf62994811
Author: Juliusz Sompolski <ju...@databricks.com>
AuthorDate: Thu Aug 17 17:49:28 2023 +0200

    [SPARK-44849] Expose SparkConnectExecutionManager.listActiveExecutions
    
    ### What changes were proposed in this pull request?
    
    Make list of active executions accessible via SparkConnectService.listActiveExecutions
    
    ### Why are the changes needed?
    
    Some internal components outside `connect` would like to have access to that. Add a method to expose it.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    CI
    
    Closes #42535 from juliuszsompolski/SPARK-44849.
    
    Authored-by: Juliusz Sompolski <ju...@databricks.com>
    Signed-off-by: Herman van Hovell <he...@databricks.com>
---
 .../org/apache/spark/sql/connect/service/SparkConnectService.scala  | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectService.scala b/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectService.scala
index fe773e4b704..269e47609db 100644
--- a/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectService.scala
+++ b/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectService.scala
@@ -348,6 +348,12 @@ object SparkConnectService extends Logging {
     userSessionMapping.get((userId, sessionId), default)
   }
 
+  /**
+   * If there are no executions, return Left with System.currentTimeMillis of last active
+   * execution. Otherwise return Right with list of ExecuteInfo of all executions.
+   */
+  def listActiveExecutions: Either[Long, Seq[ExecuteInfo]] = executionManager.listActiveExecutions
+
   /**
    * Used for testing
    */


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org