You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "haiyangsun-db (via GitHub)" <gi...@apache.org> on 2026/03/30 07:46:35 UTC
[PR] [SPARK-55278] Introduce core abstraction for UDF worker. [spark]
haiyangsun-db opened a new pull request, #55089:
URL: https://github.com/apache/spark/pull/55089
### What changes were proposed in this pull request?
This PR introduces the foundational package structure and core abstractions for the language-agnostic UDF worker framework described in SPIP [SPARK-55278](https://issues.apache.org/jira/browse/SPARK-55278).
The new udf/worker module contains two sub-modules:
- proto/ — Protobuf definition of UDFWorkerSpecification (currently a placeholder; full schema to follow).
- core/ — Engine-side APIs (all @Experimental):
- WorkerSpec — typed Scala wrapper around the protobuf spec.
- WorkerDispatcher — manages workers for a given spec; creates sessions. Handles pooling, reuse, and lifecycle behind the scenes.
- WorkerSession — represents one single UDF execution. Not 1-to-1 with a worker process; multiple sessions may share the same underlying worker.
- WorkerSecurityScope — identifies a security boundary for worker connection pooling.
### Why are the changes needed?
This is the first step toward a language-agnostic UDF protocol for Spark that enables UDF workers written in any language to communicate with the Spark engine through a well-defined specification and API boundary. The abstractions
introduced here establish the core contract that concrete implementations (e.g., process-based or gRPC-based workers) will build on.
### Does this PR introduce _any_ user-facing change?
No. All new APIs are marked @Experimental and there are no behavioral changes to existing code.
### How was this patch tested?
This PR introduces API abstractions only (traits, abstract classes, and a placeholder protobuf message) with no runtime logic. Compilation is verified via Maven and SBT. Tests for concrete implementations will be added in follow-up
PRs.
### Was this patch authored or co-authored using generative AI tooling?
Yes, AI helps polishing the comment text and improve the README file.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55278] Introduce module and core abstraction for language-agnostic UDF worker. [spark]
Posted by "haiyangsun-db (via GitHub)" <gi...@apache.org>.
haiyangsun-db commented on PR #55089:
URL: https://github.com/apache/spark/pull/55089#issuecomment-4175447542
@hvanhovell please feel free to take a look
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55278] Introduce core abstraction for UDF worker. [spark]
Posted by "haiyangsun-db (via GitHub)" <gi...@apache.org>.
haiyangsun-db commented on code in PR #55089:
URL: https://github.com/apache/spark/pull/55089#discussion_r3021859981
##########
udf/worker/core/src/main/scala/org/apache/spark/udf/worker/core/WorkerSecurityScope.scala:
##########
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.spark.udf.worker.core
+
+import org.apache.spark.annotation.Experimental
+
+/**
+ * :: Experimental ::
+ * Identifies a security boundary for worker connection pooling.
+ *
+ * Workers are only reused within the same security scope.
+ */
+@Experimental
+abstract class WorkerSecurityScope
Review Comment:
Fixed, making equals/hardCode mandatory
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55278] Introduce module and core abstraction for language-agnostic UDF worker. [spark]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on code in PR #55089:
URL: https://github.com/apache/spark/pull/55089#discussion_r3045645963
##########
udf/worker/proto/pom.xml:
##########
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.spark</groupId>
+ <artifactId>spark-parent_2.13</artifactId>
+ <version>4.2.0-SNAPSHOT</version>
+ <relativePath>../../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>spark-udf-worker-proto_2.13</artifactId>
+ <packaging>jar</packaging>
+ <name>Spark Project UDF Worker Proto</name>
+ <url>https://spark.apache.org/</url>
+
+ <properties>
+ <sbt.project.name>udf-worker-proto</sbt.project.name>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java</artifactId>
+ <scope>compile</scope>
Review Comment:
Why doesn't this module perform protobuf shade + relocation in the same way as other modules(like `core`, `protobuf` and `connect server & client`)?
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55278] Introduce module and core abstraction for language-agnostic UDF worker. [spark]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on code in PR #55089:
URL: https://github.com/apache/spark/pull/55089#discussion_r3045645963
##########
udf/worker/proto/pom.xml:
##########
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.spark</groupId>
+ <artifactId>spark-parent_2.13</artifactId>
+ <version>4.2.0-SNAPSHOT</version>
+ <relativePath>../../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>spark-udf-worker-proto_2.13</artifactId>
+ <packaging>jar</packaging>
+ <name>Spark Project UDF Worker Proto</name>
+ <url>https://spark.apache.org/</url>
+
+ <properties>
+ <sbt.project.name>udf-worker-proto</sbt.project.name>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java</artifactId>
+ <scope>compile</scope>
Review Comment:
Why doesn't this module perform protobuf shade + relocation in the same way as other modules(`core`, `protobuf` and `connect server & client`)?
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55278] Introduce module and core abstraction for language-agnostic UDF worker. [spark]
Posted by "haiyangsun-db (via GitHub)" <gi...@apache.org>.
haiyangsun-db commented on code in PR #55089:
URL: https://github.com/apache/spark/pull/55089#discussion_r3046767967
##########
udf/worker/proto/pom.xml:
##########
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.spark</groupId>
+ <artifactId>spark-parent_2.13</artifactId>
+ <version>4.2.0-SNAPSHOT</version>
+ <relativePath>../../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>spark-udf-worker-proto_2.13</artifactId>
+ <packaging>jar</packaging>
+ <name>Spark Project UDF Worker Proto</name>
+ <url>https://spark.apache.org/</url>
+
+ <properties>
+ <sbt.project.name>udf-worker-proto</sbt.project.name>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java</artifactId>
+ <scope>compile</scope>
Review Comment:
Here is the PR https://github.com/apache/spark/pull/55240 for adding the shading rule, please feel free to take a look
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55278] Introduce core abstraction for UDF worker. [spark]
Posted by "haiyangsun-db (via GitHub)" <gi...@apache.org>.
haiyangsun-db commented on code in PR #55089:
URL: https://github.com/apache/spark/pull/55089#discussion_r3021857537
##########
udf/worker/core/src/main/scala/org/apache/spark/udf/worker/core/WorkerSession.scala:
##########
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.spark.udf.worker.core
+
+import org.apache.spark.annotation.Experimental
+
+/**
+ * :: Experimental ::
+ * Represents one single UDF execution.
+ *
+ * A [[WorkerSession]] is obtained from [[WorkerDispatcher#createSession]] and
+ * can carry per-execution state for that UDF invocation. Implementations may
+ * add concrete data-processing methods and lifecycle hooks as needed.
+ *
+ * A WorkerSession is not 1-to-1 mapped to an actual worker process. Multiple
+ * WorkerSessions may be backed by the same worker when the worker is reused.
+ * Worker reuse and pooling are managed by each [[WorkerDispatcher]]
+ * implementation based on the [[WorkerSpecification]].
+ */
+@Experimental
+abstract class WorkerSession
Review Comment:
Fixed, added AutoClosable.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55278] Introduce module and core abstraction for language-agnostic UDF worker. [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan closed pull request #55089: [SPARK-55278] Introduce module and core abstraction for language-agnostic UDF worker.
URL: https://github.com/apache/spark/pull/55089
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55278] Introduce module and core abstraction for language-agnostic UDF worker. [spark]
Posted by "haiyangsun-db (via GitHub)" <gi...@apache.org>.
haiyangsun-db commented on PR #55089:
URL: https://github.com/apache/spark/pull/55089#issuecomment-4171068239
Hi @holdenk , this is the first PR for the language-agnostic UDF work. The main goal of this PR is to set up the module and few key worker abstractions. More detailed pieces will follow in subsequent PRs. Please feel free to take a look.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55278] Introduce module and core abstraction for language-agnostic UDF worker. [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on PR #55089:
URL: https://github.com/apache/spark/pull/55089#issuecomment-4198107170
thanks. merging to master!
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55278] Introduce module and core abstraction for language-agnostic UDF worker. [spark]
Posted by "haiyangsun-db (via GitHub)" <gi...@apache.org>.
haiyangsun-db commented on code in PR #55089:
URL: https://github.com/apache/spark/pull/55089#discussion_r3046459003
##########
udf/worker/proto/pom.xml:
##########
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.spark</groupId>
+ <artifactId>spark-parent_2.13</artifactId>
+ <version>4.2.0-SNAPSHOT</version>
+ <relativePath>../../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>spark-udf-worker-proto_2.13</artifactId>
+ <packaging>jar</packaging>
+ <name>Spark Project UDF Worker Proto</name>
+ <url>https://spark.apache.org/</url>
+
+ <properties>
+ <sbt.project.name>udf-worker-proto</sbt.project.name>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java</artifactId>
+ <scope>compile</scope>
Review Comment:
@LuciferYang thank you for pointing out. It should align with connect and core, i will work on a followup to add the shading as others do, thanks!
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55278] Introduce core abstraction for UDF worker. [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on code in PR #55089:
URL: https://github.com/apache/spark/pull/55089#discussion_r3021251971
##########
udf/worker/core/src/main/scala/org/apache/spark/udf/worker/core/WorkerSession.scala:
##########
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.spark.udf.worker.core
+
+import org.apache.spark.annotation.Experimental
+
+/**
+ * :: Experimental ::
+ * Represents one single UDF execution.
+ *
+ * A [[WorkerSession]] is obtained from [[WorkerDispatcher#createSession]] and
+ * can carry per-execution state for that UDF invocation. Implementations may
+ * add concrete data-processing methods and lifecycle hooks as needed.
+ *
+ * A WorkerSession is not 1-to-1 mapped to an actual worker process. Multiple
+ * WorkerSessions may be backed by the same worker when the worker is reused.
+ * Worker reuse and pooling are managed by each [[WorkerDispatcher]]
+ * implementation based on the [[WorkerSpecification]].
+ */
+@Experimental
+abstract class WorkerSession
Review Comment:
`WorkerSession` does not extend `AutoCloseable`, while `WorkerDispatcher` does. Since a session "can carry per-execution state" and implementations "may add lifecycle hooks," callers have no standard way to release per-session resources. If `AutoCloseable` is added later, all callers must be updated. Consider `abstract class WorkerSession extends AutoCloseable` from the start, even if concrete implementations initially no-op on `close()`.
##########
udf/worker/core/src/main/scala/org/apache/spark/udf/worker/core/WorkerSecurityScope.scala:
##########
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.spark.udf.worker.core
+
+import org.apache.spark.annotation.Experimental
+
+/**
+ * :: Experimental ::
+ * Identifies a security boundary for worker connection pooling.
+ *
+ * Workers are only reused within the same security scope.
+ */
+@Experimental
+abstract class WorkerSecurityScope
Review Comment:
The Scaladoc says "Workers are only reused within the same security scope," which implies dispatcher implementations will compare scopes for equality. The default `Object.equals` (reference equality) means structurally equivalent scopes won't match, silently preventing worker reuse. Consider documenting that subclasses must override `equals`/`hashCode`, or making this a `sealed trait` with concrete implementations that enforce it.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org