[Feature][Common] Migrate conf package from Scala to Java#4440
Draft
och5351 wants to merge 2 commits into
Draft
Conversation
och5351
marked this pull request as draft
July 19, 2026 12:45
och5351
force-pushed
the
feature/convert-java-streampark-common-conf-package
branch
from
July 19, 2026 13:24
e8ca259 to
91f2bbd
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What this PR does
Converts 9 Scala files in
streampark-common/src/main/scala/org/apache/streampark/common/conf/to pure Java as part of the Scala removal plan (#4408).Converted files
ConfigKeys.scalaConfigKeys.javaInternalOption.scalaInternalOption.javaInternalConfigHolder.scalaInternalConfigHolder.javaCommonConfig.scalaCommonConfig.javaK8sFlinkConfig.scalaK8sFlinkConfig.javaConfigOption.scalaConfigOption.javaWorkspace.scalaWorkspace.javaFlinkVersion.scalaFlinkVersion.javaSparkVersion.scalaSparkVersion.javaNotable design decisions
InternalOption<T>: Made generic (InternalOption<T>) to eliminate unchecked casts inInternalConfigHolder.get(InternalOption<T>). Each config constant exposes a static accessor method (e.g.CommonConfig.MAVEN_SETTINGS_PATH()) to preserve backward compatibility with existing Java callers that relied on Scalavalcompiling to a no-arg method.InternalOptionaccessors: Added bothgetKey()-style (Java convention) andkey()-style (Scala case class compatible) accessors to support mixed callers during the migration period.ConfigOption: Scala implicit parameters (implicit prefix: String,implicit prop: Properties) converted to Builder pattern.Workspace: Scalalazy valfields converted to eagerly-initialized constructor fields with DCL (volatile) for singleton instances.FlinkVersion/SparkVersion: Scalalazy valfields compile to no-arg methods in bytecode, so accessor methods use the same names withoutgetprefix (e.g.version(),scalaVersion()) to keep Scala callers working.Scope extension —
TypeCastUtils.javaTypeCastUtils.javais added to theutilpackage as a replacement forImplicits.cast[T], a Scala extension method that Java code cannot call. Three of the converted files require string-to-type casting.Implicits.scala(and itscastmethod) will be removed when all remaining Scala files are converted.Also updated
EnvInitializer.javainstreampark-console-service: updated rawInternalOptionreference toInternalOption<?>following the generic change.Testing
mvn compile -pl streampark-commonpassesmvn test -pl streampark-commonpasses (13 tests)closes #4408 (partial — Phase 1.1)