Skip to content

HDDS-15082. Add User facing Config Contract#10147

Open
henrybear327 wants to merge 1 commit intoapache:masterfrom
henrybear327:HDDS-15082
Open

HDDS-15082. Add User facing Config Contract#10147
henrybear327 wants to merge 1 commit intoapache:masterfrom
henrybear327:HDDS-15082

Conversation

@henrybear327
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Introduce user-facing paremeters for local ozone cluster spin up.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-15082

How was this patch tested?

Unit tests.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an internal ozone local CLI surface and supporting configuration objects to define a user-facing configuration contract for spinning up a local single-node Ozone cluster.

Changes:

  • Introduces OzoneLocal (hidden) CLI with run subcommand and env/CLI-based config resolution into LocalOzoneClusterConfig.
  • Adds LocalOzoneClusterConfig and LocalOzoneRuntime as the local runtime contract/config model.
  • Adds unit tests covering command metadata/help visibility and config parsing/precedence/validation.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/local/OzoneLocal.java New internal CLI entry point and config resolution logic from flags/env vars.
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/local/LocalOzoneClusterConfig.java New config model + builder + FormatMode parsing for user-facing values.
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/local/LocalOzoneRuntime.java New runtime interface contract for local single-node runtimes.
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/local/package-info.java New package documentation for the local runtime support package.
hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/local/TestOzoneLocal.java Tests for CLI metadata, help behavior, and env/CLI precedence + validation errors.
hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/local/TestLocalOzoneClusterConfig.java Tests for builder defaults/overrides and FormatMode parsing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

: parsePort(environment.get(ENV_S3G_PORT), ENV_S3G_PORT,
LocalOzoneClusterConfig.DEFAULT_PORT);

boolean resolvedS3gEnabled = withoutS3g ? false
Comment on lines +194 to +196
boolean resolvedEphemeral = ephemeral || parseBoolean(
environment.get(ENV_EPHEMERAL), ENV_EPHEMERAL,
LocalOzoneClusterConfig.DEFAULT_EPHEMERAL);
Comment on lines +154 to +158
public static FormatMode fromString(String value) {
String normalized = value.trim().toUpperCase(Locale.ROOT)
.replace('-', '_');
return valueOf(normalized);
}
Comment on lines +147 to +151
@Override
public Void call() {
resolveConfig(new OzoneConfiguration());
return null;
}
Comment thread hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/local/OzoneLocal.java Outdated
Comment thread hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/local/OzoneLocal.java Outdated
Comment thread hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/local/OzoneLocal.java Outdated
Comment thread hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/local/OzoneLocal.java Outdated
@ivandika3 ivandika3 added the ozone-local HDDS-14893 label Apr 28, 2026
@peterxcli
Copy link
Copy Markdown
Member

@henrybear327 please merge upstream master, thanks!

@peterxcli
Copy link
Copy Markdown
Member

feel free to request me to for review if you think this is ready, thanks!

@chungen0126
Copy link
Copy Markdown
Contributor

Thanks @henrybear327 for the patch.

Please consider leveraging PicoCLI's built-in environment variable support (e.g., @option(..., defaultValue = "${env:OZONE_LOCAL_DATANODES:-1}")). This automatically handles type binding and validation for us, which could help remove a lot of boilerplate code in resolveConfig. It might keep the code much cleaner and simpler. See https://picocli.info/#_variables_in_default_values.

@henrybear327 henrybear327 force-pushed the HDDS-15082 branch 2 times, most recently from 3d6102a to 63b3817 Compare May 10, 2026 22:29
@henrybear327
Copy link
Copy Markdown
Contributor Author

Thanks @henrybear327 for the patch.

Please consider leveraging PicoCLI's built-in environment variable support (e.g., @option(..., defaultValue = "${env:OZONE_LOCAL_DATANODES:-1}")). This automatically handles type binding and validation for us, which could help remove a lot of boilerplate code in resolveConfig. It might keep the code much cleaner and simpler. See https://picocli.info/#_variables_in_default_values.

Thank you for the feedback! Addressed in the latest commit.

@henrybear327
Copy link
Copy Markdown
Contributor Author

feel free to request me to for review if you think this is ready, thanks!

Hi @peterxcli, PTAL :) Thank you!

@henrybear327 henrybear327 requested a review from peterxcli May 10, 2026 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ozone-local HDDS-14893

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants