Skip to content

Conversation

@eric-maynard
Copy link
Contributor

Description

I've had a hard time working with PolarisConfiguration and ran into various casting issues during testing. Before we have too many configurations, let's impose some structure on these and make it easier to get values out of configs.

I've also unified the catalog-level and service-level configs here, and added a description for each config.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Refactor

Checklist:

Please delete options that are not relevant.

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

@eric-maynard eric-maynard requested a review from a team as a code owner August 6, 2024 04:52
Copy link
Contributor

@flyrain flyrain left a comment

Choose a reason for hiding this comment

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

LGTM overall. Some questions:

Do we consider reusing other libs like Apache Common Configuration, or Lombok(need Spring)? For exmaple, we don't have to write our own type casting, the former can convert data type as the following code shows.

Configuration config = configs.properties("config.properties");

            // Convert to different data types
            String appName = config.getString("app.name");
            int port = config.getInt("app.port");
            boolean isActive = config.getBoolean("app.active");
            double timeout = config.getDouble("app.timeout");

Lombok is even simpler with less code. I know it has to combine with spring boot, but considering a lot of benefits it brings as well as great eco system around spring. It's worth to explore.

@eric-maynard
Copy link
Contributor Author

eric-maynard commented Aug 6, 2024

Looks good @flyrain, I think we should continue to think about this. For one thing, I want to make sure we have a way to surface these in the docs. I'd be open to adding a library here, but I thought it would be wise to incrementally improve this.

wrt casting I believe our current setup is supposed to not require casting, but when you override DropWizard configs like this test does the value does not cast from String to Boolean correctly. I added the tryCast method as a way to brute-force the correct type for now. Hopefully if we migrate to using some framework that will go away.

@snazy
Copy link
Member

snazy commented Aug 6, 2024

The actually most advanced config library I've seen is smallrye-config.
We already have code (in Nessie) that converts javadoc from smallrye-config configuration interfaces into markdown.

@flyrain flyrain merged commit 4aea20e into apache:main Aug 6, 2024
snazy added a commit to snazy/polaris that referenced this pull request Nov 20, 2025
* fix(deps): update dependency com.google.errorprone:error_prone_core to v2.41.0 (apache#2181)

* Simplify bootstrapServiceAndCreatePolarisPrincipalForRealm (apache#2172)

this is a small follow-up to 5faa371
because the same pattern existed for this method.

note that we do some minor additional "formatting" changes to minimize
the diff between the two files (as they were originally copy pasted).
this could lead to having a common base class in the future.

* fix(deps): update dependency boto3 to v1.39.13 (apache#2182)

* Add podman support (apache#2143)

* Add Polaris Community Meeting 2025-07-24 (apache#2184)

* fix(deps): update dependency com.adobe.testing:s3mock-testcontainers to v4.7.0 (apache#2185)

* Push AccessConfig creation to PolarisStorageIntegration (apache#2171)

This refactoring does not change Polaris behaviour.

* Move storage-specific access properties processing logic from
  core code to storage integration implementations.

* Add `isExpirationTimestamp` flag to `StorageAccessProperty` to
  allow them to be processed uniformly.

* Prepare for supporting access config properties that may have
  different values in Polaris Servers and Clients. This enables
  future enhancements to support different S3 endpoint DNS names
  in servers and clients for apache#1530

* Fix doc to remove privileges may take up to one hour to take effect and add Policy to securable object (apache#2009)

* fix(deps): update dependency boto3 to v1.39.14 (apache#2186)

* chore(deps): update plugin jetbrains-changelog to v2.3.0 (apache#2187)

* fix(deps): update dependency software.amazon.awssdk:bom to v2.32.9 (apache#2191)

* Add Principal lookup helpers to PolarisMetaStoreManager (apache#2174)

`PolarisMetaStoreManager.readEntityByName` is quite a low-level api, so we can simplify a lot of callers with additional helpers:

- add `PolarisMetaStoreManager.findRootPrincipal`
- add `PolarisMetaStoreManager.findPrincipalByName`
- add `PolarisMetaStoreManager.findPrincipalRoleByName`

also we now prefer `PolarisEntityConstants` where applicable

* Remove PolarisDiagnostics from json utils (apache#2176)

With transitive cleanups of, PolarisStorageConfigurationInfo, ConnectionConfigInfoDpo, BaseMetaStoreManager, PolarisObjectMapperUtil, CurrentContext

* Fix Namespace resolution on grant/revoke privilege operations (apache#2170)

* Fix Namespace resolution on grant/revoke privilege operations

* Move isFullyResolvedNamespace to PolarisResolvedPathWrapper

* fix(deps): update dependency boto3 to v1.39.15 (apache#2199)

* fix(deps): update dependency com.google.cloud:google-cloud-storage-bom to v2.54.0 (apache#2200)

* fix(deps): update dependency boto3 to v1.39.16 (apache#2209)

* chore(deps): update actions/stale digest to a92fd57 (apache#2208)

* fix(deps): update quarkus platform and group to v3.25.0 (apache#2167)

* NoSQL updates

* Last merged commit 914be46

---------

Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Christopher Lambert <xn137@gmx.de>
Co-authored-by: Yong Zheng <yongzheng0809@gmail.com>
Co-authored-by: JB Onofré <jbonofre@apache.org>
Co-authored-by: Dmitri Bourlatchkov <dmitri.bourlatchkov@gmail.com>
Co-authored-by: CG <cgpoh@users.noreply.github.com>
Co-authored-by: Pooja Nilangekar <poojan@umd.edu>
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.

3 participants