Skip to content

Remove "default base location" arg from CatalogEntity.setStorageConfigurationInfo() - #5276

Open
dimas-b wants to merge 2 commits into
apache:mainfrom
dimas-b:default-loc-validation
Open

Remove "default base location" arg from CatalogEntity.setStorageConfigurationInfo()#5276
dimas-b wants to merge 2 commits into
apache:mainfrom
dimas-b:default-loc-validation

Conversation

@dimas-b

@dimas-b dimas-b commented Aug 11, 2026

Copy link
Copy Markdown
Contributor
  • The old defaultBaseLocation argument of the "set" method was NOT actually used to set the default base location in the Catalog object builder.

  • The old defaultBaseLocation argument was used for validation, but nothing guaranteed that the caller passed in the right value.

  • Remove the defaultBaseLocation argument

  • Get the default base location value from current properties (which is the source of truth for this value).

  • Note: most callers on this builder method already set the default base location before invoking setStorageConfigurationInfo()

  • Keep the exception if setStorageConfigurationInfo() is invoked without first setting the default base location.

This is a follow-up to #4422

Checklist

  • 🛡️ Don't disclose security issues! (contact security@apache.org)
  • 🔗 Clearly explained why the changes are needed, or linked related issues: Fixes #
  • 🧪 Added/updated tests with good coverage, or manually tested (and explained how)
  • 💡 Added comments for complex logic
  • 🧾 Updated CHANGELOG.md (if needed)
  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed)

nandorKollar
nandorKollar previously approved these changes Aug 13, 2026
@github-project-automation github-project-automation Bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Aug 13, 2026
RealmConfig realmConfig, StorageConfigInfo storageConfigModel, String defaultBaseLocation) {
RealmConfig realmConfig, StorageConfigInfo storageConfigModel) {
if (storageConfigModel != null) {
String defaultBaseLocation = properties.get(DEFAULT_BASE_LOCATION_KEY);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This makes the setter read mutable builder state, so the builder is order-sensitive now: call setStorageConfigurationInfo before setDefaultBaseLocation and it throws "Must specify default base location" even though the caller does set it.

Would it make sense to assemble the storage config in build() too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point. Will update.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

…igurationInfo()`

* The old `defaultBaseLocation` argument of the "set" method was NOT actually used to set the default base location in the Catalog object builder.

* The old `defaultBaseLocation` argument was used for validation, but nothing guaranteed that the caller passed in the right value.

* Remove the `defaultBaseLocation` argument

* Get the default base location value from current `properties` (which is the source of truth for this value).

* Note: most callers on this builder method already set the default base location before invoking `setStorageConfigurationInfo()`

* Keep the exception if `setStorageConfigurationInfo()` is invoked without first setting the default base location.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants