Skip to content

[Migrate] Convert streampark-common from Scala to Java#4458

Open
shangeyao wants to merge 6 commits into
apache:devfrom
shangeyao:migrate/4445-common-scala-to-java
Open

[Migrate] Convert streampark-common from Scala to Java#4458
shangeyao wants to merge 6 commits into
apache:devfrom
shangeyao:migrate/4445-common-scala-to-java

Conversation

@shangeyao

Copy link
Copy Markdown
Contributor

Summary

  • Migrate streampark-common core utilities, configuration, and enums from Scala to Java.
  • Keep a thin Scala compatibility layer (Implicits, Workspace, FsOperator, ApiType/PlannerType/TableMode, ConfigKeys, PropertiesUtils, Logger) so existing Flink/Spark/Console modules compile without changes in this PR.
  • Replace Scala tests with JUnit 5 for migrated Java code; retain Scala tests where the compatibility layer remains.

Closes #4445

Test plan

  • ./mvnw -pl streampark-common test (57 tests pass)
  • ./mvnw clean install -DskipTests (full backend compile)
  • ./mvnw -B -q -nsu checkstyle:check spotless:check
  • CI backend + unit-test workflows

Made with Cursor

Migrate the common module to Java while retaining a thin Scala compatibility
layer (Implicits, Workspace, FsOperator, enums) so downstream modules compile
unchanged. Adds Java implementations for utilities and config with API shims
for Scala interop.

Co-authored-by: Cursor <cursoragent@cursor.com>
shangeyao and others added 2 commits July 25, 2026 17:08
Handle InterruptedException correctly in CommandUtils and fix regex
precedence in FlinkConfigurationUtils to satisfy Quality Gate.

Co-authored-by: Cursor <cursoragent@cursor.com>
Convert ConfigKeys, Workspace, PropertiesUtils, and FsOperator family to Java
with @JvmStatic/static APIs for Scala interop. Keep only Implicits, Logger, and
Scala Enumeration enums in Scala. Fix InterruptedException handling and regex
patterns to satisfy SonarCloud reliability rules.

Co-authored-by: Cursor <cursoragent@cursor.com>
@shangeyao shangeyao changed the title [Migrate] Convert streampark-common from Scala to Java (#4445) [Migrate] Convert streampark-common from Scala to Java Jul 25, 2026
Remove all Scala sources from streampark-common (main and test). Move
Implicits and Logger trait to new streampark-common-scala-bridge module
for downstream Scala interop. Add Java enums (ApiType, PlannerType,
TableMode) and LoggerSupport in common.

Co-authored-by: Cursor <cursoragent@cursor.com>
shangeyao and others added 2 commits July 25, 2026 18:43
Rewrite quoted -D property regex with backreferences to resolve S5850/S8786, suppress intentional ConfigKeys API smells, and clean up minor LoggerSupport/LfsOperatorTest findings.

Co-authored-by: Cursor <cursoragent@cursor.com>
Defer remote Workspace initialization to match Scala lazy behavior and avoid
HADOOP_HOME lookup at class load; harden Hadoop conf dir resolution when env
vars are absent; fix DateUtils timezone handling for CI runners.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Common] Migrate streampark-common from Scala to Java

1 participant