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

dongjoon 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 632dd3319b5 [SPARK-44966][CORE][CONNECT] Change the never changed 
`var` to `val`
632dd3319b5 is described below

commit 632dd3319b56716cc610de438059740331a5ffe1
Author: yangjie01 <[email protected]>
AuthorDate: Fri Aug 25 08:32:15 2023 -0700

    [SPARK-44966][CORE][CONNECT] Change the never changed `var` to `val`
    
    ### What changes were proposed in this pull request?
    This PR replaces unchanged `var` with `val`.
    
    ### Why are the changes needed?
    Use `val` instead of `var` when possible.
    
    ### Does this PR introduce _any_ user-facing change?
    No
    
    ### How was this patch tested?
    Pass GitHub Actions
    
    ### Was this patch authored or co-authored using generative AI tooling?
    No
    
    Closes #42682 from LuciferYang/SPARK-44966.
    
    Authored-by: yangjie01 <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 .../spark/sql/connect/execution/ExecuteGrpcResponseSender.scala   | 2 +-
 .../spark/sql/connect/execution/ExecuteResponseObserver.scala     | 8 ++++----
 .../apache/spark/sql/connect/execution/ExecuteThreadRunner.scala  | 2 +-
 .../src/main/scala/org/apache/spark/api/python/PythonRunner.scala | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git 
a/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/execution/ExecuteGrpcResponseSender.scala
 
b/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/execution/ExecuteGrpcResponseSender.scala
index 6b8fcde1156..f961dfaee2e 100644
--- 
a/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/execution/ExecuteGrpcResponseSender.scala
+++ 
b/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/execution/ExecuteGrpcResponseSender.scala
@@ -42,7 +42,7 @@ private[connect] class ExecuteGrpcResponseSender[T <: 
Message](
 
   // the executionObserver object is used as a synchronization lock between the
   // ExecuteGrpcResponseSender consumer and ExecuteResponseObserver producer.
-  private var executionObserver = executeHolder.responseObserver
+  private val executionObserver = executeHolder.responseObserver
     .asInstanceOf[ExecuteResponseObserver[T]]
 
   private var interrupted = false
diff --git 
a/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/execution/ExecuteResponseObserver.scala
 
b/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/execution/ExecuteResponseObserver.scala
index d9db07fd228..8222fa1f441 100644
--- 
a/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/execution/ExecuteResponseObserver.scala
+++ 
b/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/execution/ExecuteResponseObserver.scala
@@ -86,10 +86,10 @@ private[connect] class ExecuteResponseObserver[T <: 
Message](val executeHolder:
   private var responseSender: Option[ExecuteGrpcResponseSender[T]] = None
 
   // Statistics about cached responses.
-  private var cachedSizeUntilHighestConsumed = CachedSize()
-  private var cachedSizeUntilLastProduced = CachedSize()
-  private var autoRemovedSize = CachedSize()
-  private var totalSize = CachedSize()
+  private val cachedSizeUntilHighestConsumed = CachedSize()
+  private val cachedSizeUntilLastProduced = CachedSize()
+  private val autoRemovedSize = CachedSize()
+  private val totalSize = CachedSize()
 
   /**
    * Total size of response to be held buffered after giving out with 
getResponse. 0 for none, any
diff --git 
a/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/execution/ExecuteThreadRunner.scala
 
b/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/execution/ExecuteThreadRunner.scala
index 62083d4892f..96ed593e72f 100644
--- 
a/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/execution/ExecuteThreadRunner.scala
+++ 
b/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/execution/ExecuteThreadRunner.scala
@@ -40,7 +40,7 @@ private[connect] class ExecuteThreadRunner(executeHolder: 
ExecuteHolder) extends
   // The newly created thread will inherit all InheritableThreadLocals used by 
Spark,
   // e.g. SparkContext.localProperties. If considering implementing a 
thread-pool,
   // forwarding of thread locals needs to be taken into account.
-  private var executionThread: Thread = new ExecutionThread()
+  private val executionThread: Thread = new ExecutionThread()
 
   private var interrupted: Boolean = false
 
diff --git a/core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala 
b/core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala
index d7801d2e83b..db95e6c2bd6 100644
--- a/core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala
+++ b/core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala
@@ -789,7 +789,7 @@ private[spark] object PythonRunner {
   // already running worker monitor threads for worker and task attempts ID 
pairs
   val runningMonitorThreads = ConcurrentHashMap.newKeySet[(PythonWorker, 
Long)]()
 
-  private var printPythonInfo: AtomicBoolean = new AtomicBoolean(true)
+  private val printPythonInfo: AtomicBoolean = new AtomicBoolean(true)
 
   def apply(func: PythonFunction, jobArtifactUUID: Option[String]): 
PythonRunner = {
     if (printPythonInfo.compareAndSet(true, false)) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to