Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#950] improvment(common): Add a method in ConfigEntry called create to support configurations with no default value #1141

Merged
merged 5 commits into from
Dec 20, 2023

Conversation

qqqttt123
Copy link
Contributor

@qqqttt123 qqqttt123 commented Dec 13, 2023

What changes were proposed in this pull request?

Some configuration options are necessary but don't have default value.

Why are the changes needed?

Fix: #950

Does this PR introduce any user-facing change?

Change some configuration options from `` to none

How was this patch tested?

CI passed.

…reate to support configurations with no default value
yuqi1129
yuqi1129 previously approved these changes Dec 18, 2023
Copy link
Contributor

@yuqi1129 yuqi1129 left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -37,6 +37,7 @@ public class ConfigEntry<T> {
@Getter private boolean isDeprecated;

private boolean isOptional;
private boolean isNoDefault;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use another name, isNoDefault seems a bit awkward.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about hasNoDefault?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

*
* @return A new ConfigEntry instance with no default value.
*/
public ConfigEntry<T> createWithNoDefault() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think create is enough, no need to specify with "WithNoDefault".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, will fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@@ -33,7 +33,7 @@ public interface OAuthConfig extends Configs {
.doc("The signing key of JWT when Gravitino uses OAuth as the authenticator")
.version("0.3.0")
.stringConf()
.createWithDefault("");
.createWithNoDefault();
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you should check all the configs not only here, but also in each catalogs, to change them if there're no default value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. I will modify them at the same time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@jerryshao
Copy link
Contributor

@qqqttt123 can you please create a follow-up issue to address the validity of the value as we discussed offline?

@jerryshao jerryshao merged commit fbce0fe into apache:main Dec 20, 2023
4 checks passed
@qqqttt123 qqqttt123 deleted the ISSUE-950 branch December 22, 2023 12:54
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.

[Improvement] Add a method in ConfigEntry called create to support configurations with no default value
3 participants