Skip to content

Comments

GCS client library migration in Java SDK - part 2c#37597

Open
shunping wants to merge 1 commit intoapache:masterfrom
shunping:gcs-migration-2c
Open

GCS client library migration in Java SDK - part 2c#37597
shunping wants to merge 1 commit intoapache:masterfrom
shunping:gcs-migration-2c

Conversation

@shunping
Copy link
Collaborator

@shunping shunping commented Feb 13, 2026

Some clean-up on the public API module for GcsUtil after #37502 and #37592.

  • Removed test-only functions from GcsUtil. Those functions are for V1 only and they are not part of the public APIs.
  • Also modified the related tests accordingly.

@shunping shunping changed the title Open GCS client library migration in Java SDK - part 2c GCS client library migration in Java SDK - part 2c Feb 13, 2026
@shunping shunping force-pushed the gcs-migration-2c branch 2 times, most recently from 1e9247a to b5c2031 Compare February 18, 2026 18:59
@shunping
Copy link
Collaborator Author

r: @Abacn

@shunping shunping marked this pull request as ready for review February 18, 2026 20:38
@apache apache deleted a comment from gemini-code-assist bot Feb 18, 2026
@github-actions
Copy link
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment assign set of reviewers

@shunping shunping requested a review from Abacn February 18, 2026 20:40
@shunping
Copy link
Collaborator Author

/gemini summary

@gemini-code-assist
Copy link
Contributor

Summary of Changes

This pull request continues the migration of the GCS client library in the Java SDK by performing further cleanup on the GcsUtil public API module. The primary goal is to remove test-only functions and internal implementation details that are not part of the intended public interface, thereby simplifying the class and improving its maintainability. Related tests have been adjusted to accommodate these changes, ensuring the integrity of the GCS utility functions.

Highlights

  • API Cleanup: Removed numerous internal and test-only methods from the GcsUtil class, streamlining its public API and focusing on core functionalities.
  • Constructor Simplification: Simplified the GcsUtil constructor to delegate the creation of its internal GcsUtilV1 and GcsUtilV2 instances to their respective factory methods.
  • Method Deprecation: Deprecated getNonWildcardPrefix and isWildcard methods in GcsUtil, guiding users to use the equivalent methods directly from GcsPath.
  • Test Updates: Updated GcsUtilTest to reflect the API changes in GcsUtil, ensuring tests correctly interact with the refactored class by accessing internal methods via the delegate field.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • sdks/java/extensions/google-cloud-platform-core/src/main/java/org/apache/beam/sdk/extensions/gcp/util/GcsUtil.java
    • Removed unused imports related to V1 GCS client library components.
    • Simplified the GcsUtil constructor to use factory methods for GcsUtilV1 and GcsUtilV2 delegates.
    • Eliminated numerous @VisibleForTesting methods and their internal logic, which were specific to GcsUtilV1.
    • Deprecated getNonWildcardPrefix and isWildcard methods, recommending GcsPath alternatives.
  • sdks/java/extensions/google-cloud-platform-core/src/test/java/org/apache/beam/sdk/extensions/gcp/util/GcsUtilTest.java
    • Modified test calls to GcsUtil methods to correctly access them through the delegate field.
    • Updated the GcsUtilMock constructor to align with the refactored GcsUtil constructor.
Activity
  • The author, shunping, requested a review from @Abacn.
  • The github-actions[bot] stopped reviewer notifications, indicating that a human reviewer was assigned.
  • The author, shunping, requested a Gemini summary.

@shunping
Copy link
Collaborator Author

/gemini review

gemini-code-assist[bot]

This comment was marked as outdated.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a nice cleanup of the GcsUtil class, removing several test-only methods and improving the public API surface. The implementation details have been moved to the GcsUtilV1 delegate, which is a good refactoring. The corresponding tests in GcsUtilTest have been correctly updated to reflect these changes by accessing the delegate's methods. The changes are consistent, correct, and improve the overall code quality and maintainability. I have no further comments.

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.

1 participant