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

gurwls223 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 1e2522a9ff1 [SPARK-44310][CONNECT] The Connect Server startup log 
should display the hostname and port
1e2522a9ff1 is described below

commit 1e2522a9ff1cfd21c83494c2f5b619b06141de52
Author: panbingkun <[email protected]>
AuthorDate: Thu Jul 6 08:52:15 2023 +0900

    [SPARK-44310][CONNECT] The Connect Server startup log should display the 
hostname and port
    
    ### What changes were proposed in this pull request?
    The pr aims to make the Connect Server startup log to display the hostname 
and port.
    
    ### Why are the changes needed?
    Displaying hostname and port in logs can make it easier for service 
providers to provide intuitive information to client users.
    
    ### Does this PR introduce _any_ user-facing change?
    No.
    
    ### How was this patch tested?
    - Pass GA.
    - Manually Test.
    
    Closes #41862 from panbingkun/connect_server_improve_log.
    
    Authored-by: panbingkun <[email protected]>
    Signed-off-by: Hyukjin Kwon <[email protected]>
---
 .../apache/spark/sql/connect/service/SparkConnectServer.scala | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git 
a/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectServer.scala
 
b/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectServer.scala
index df28df59fa2..1ed8ee2ff86 100644
--- 
a/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectServer.scala
+++ 
b/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectServer.scala
@@ -17,6 +17,10 @@
 
 package org.apache.spark.sql.connect.service
 
+import java.net.InetSocketAddress
+
+import scala.collection.convert.ImplicitConversions._
+
 import org.apache.spark.internal.Logging
 import org.apache.spark.sql.SparkSession
 
@@ -31,7 +35,12 @@ object SparkConnectServer extends Logging {
     try {
       try {
         SparkConnectService.start()
-        logInfo("Spark Connect server started.")
+        SparkConnectService.server.getListenSockets.foreach { sa =>
+          val isa = sa.asInstanceOf[InetSocketAddress]
+          logInfo(
+            s"Spark Connect server started at: " +
+              s"${isa.getAddress.getHostAddress}:${isa.getPort}")
+        }
       } catch {
         case e: Exception =>
           logError("Error starting Spark Connect server", e)


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

Reply via email to