grundprinzip commented on code in PR #46182:
URL: https://github.com/apache/spark/pull/46182#discussion_r1582855870
##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectService.scala:
##########
@@ -344,35 +357,79 @@ object SparkConnectService extends Logging {
private def startGRPCService(): Unit = {
val debugMode =
SparkEnv.get.conf.getBoolean("spark.connect.grpc.debug.enabled", true)
val bindAddress = SparkEnv.get.conf.get(CONNECT_GRPC_BINDING_ADDRESS)
- val port = SparkEnv.get.conf.get(CONNECT_GRPC_BINDING_PORT)
- val sb = bindAddress match {
- case Some(hostname) =>
- logInfo(log"start GRPC service at: ${MDC(HOST, hostname)}")
- NettyServerBuilder.forAddress(new InetSocketAddress(hostname, port))
- case _ => NettyServerBuilder.forPort(port)
+ val startPort = SparkEnv.get.conf.get(CONNECT_GRPC_BINDING_PORT)
+ val sparkConnectService = new SparkConnectService(debugMode)
+ val protoReflectionService = if (debugMode)
Some(ProtoReflectionService.newInstance()) else None
+ val configuredInterceptors =
SparkConnectInterceptorRegistry.createConfiguredInterceptors()
+
+ val startService = (port: Int) => {
Review Comment:
nit: I'd rename the variable to make it easier to follow that this is a
closure and not a value.
```suggestion
val startServiceFn = (port: Int) => {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]