Skip to content

Commit

Permalink
[SPARK-49147][CORE] Mark KryoRegistrator with DeveloperApi interface
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?
Trait `org.apache.spark.serializer.KryoRegistrator` is a public interface because it is exposed via config `spark.kryo.registrator`, but it is not annotated to describe the stability level. This adds the `DeveloperApi` annotation to formalize the contract.

### Why are the changes needed?
This will help users understand the compatibility guarantees when using the trait. It is also helpful for scripts that need to identify classes with public APIs. We recently missed this trait in a script used to analyze which namespaces can be shaded.

### Does this PR introduce _any_ user-facing change?
Yes, it adds the DeveloperApi interface to the trait.

### How was this patch tested?
N/A. Annotation change only.

### Was this patch authored or co-authored using generative AI tooling?
No

Closes #47657 from robreeves/rob/stable_kryo.

Lead-authored-by: Rob Reeves <[email protected]>
Co-authored-by: Kent Yao <[email protected]>
Signed-off-by: Kent Yao <[email protected]>
  • Loading branch information
robreeves and yaooqinn committed Aug 8, 2024
1 parent 43d881a commit b54b300
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import org.apache.avro.generic.{GenericContainer, GenericData, GenericRecord}
import org.roaringbitmap.RoaringBitmap

import org.apache.spark._
import org.apache.spark.annotation.DeveloperApi
import org.apache.spark.api.python.PythonBroadcast
import org.apache.spark.internal.{Logging, MDC}
import org.apache.spark.internal.LogKeys.CLASS_NAME
Expand Down Expand Up @@ -519,6 +520,7 @@ private[spark] class KryoSerializerInstance(
* Interface implemented by clients to register their classes with Kryo when using Kryo
* serialization.
*/
@DeveloperApi
trait KryoRegistrator {
def registerClasses(kryo: Kryo): Unit
}
Expand Down

0 comments on commit b54b300

Please sign in to comment.