Skip to content

HDDS-7956. Deprecate camelCase and under_score style long options#10495

Merged
adoroszlai merged 7 commits into
apache:masterfrom
hani-fouladgar:HDDS-7956
Jun 24, 2026
Merged

HDDS-7956. Deprecate camelCase and under_score style long options#10495
adoroszlai merged 7 commits into
apache:masterfrom
hani-fouladgar:HDDS-7956

Conversation

@hani-fouladgar

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Summary

This PR standardizes Ozone CLI long option names to kebab-case (--max-size-to-move-per-iteration-in-gb) and deprecates legacy camelCase (--maxSizeToMovePerIterationInGB) and underscore (--column_family) variants.

Core infrastructure

  • Adds DeprecatedCliOptions in hadoop-hdds/cli-common with shared helpers to:
    • Detect which option was actually passed on the command line
    • Resolve canonical vs deprecated values
    • Print stderr warnings like: warning: --maxSizeToMovePerIterationInGB is deprecated, use --max-size-to-move-per-iteration-in-gb instead.
  • Deprecated aliases are kept as hidden @Option fields for backward compatibility; canonical kebab-case options are shown in help.

CLI commands updated

  • Admin / SCM: container balancer start, pipeline create/list/filter, OM/SCM leader transfer
  • Debug: ozone debug ldb (scan/value schema), Ratis log parser, container-to-key mapping
  • Repair: RocksDB manual compaction, OM DB compact
  • Shell: put key, set S3 secret, tenant assign user access ID
  • Freon / benchmarks: randomkeys, Hadoop dir generators, SCM throughput benchmark

Documentation

  • Updates CLI docs to show only kebab-case options (Container Balancer, OM/SCM HA, Repair, Ldb, Ratis log parser, Freon examples).

Backward compatibility

  • Existing scripts using camelCase or underscore long options continue to work.
  • Users are warned to migrate to kebab-case; no behavior change when using canonical options.

What is the link to the Apache JIRA

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

How was this patch tested?

  • Adds unit tests in TestContainerBalancerSubCommand verifying:
    • Deprecated flags still work but emit warnings
    • Deprecated flags are hidden from help output

@hani-fouladgar hani-fouladgar changed the title HDDS-7957. Deprecate camelCase and under_score style long options HDDS-7956. Deprecate camelCase and under_score style long options Jun 11, 2026
@adoroszlai

Copy link
Copy Markdown
Contributor

Thanks @hani-fouladgar for the patch. This will have some conflict with #10494, so let's wait until that's merged.

@hani-fouladgar hani-fouladgar marked this pull request as draft June 12, 2026 21:33
@adoroszlai

Copy link
Copy Markdown
Contributor

Thanks again @hani-fouladgar for the patch. I've found that we can avoid splitting all options with deprecated alias to deprecated and non-deprecated pairs, yet still achieve our goals (of accepting deprecated options but not showing them in help). Currently working on HDDS-15596, please bear with me.

@adoroszlai

Copy link
Copy Markdown
Contributor

Please see #10542. After that change, this PR can be much simplified.

@adoroszlai adoroszlai marked this pull request as ready for review June 23, 2026 20:10

@adoroszlai adoroszlai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @hani-fouladgar for updating the patch.

@adoroszlai adoroszlai merged commit 8e60597 into apache:master Jun 24, 2026
62 checks passed
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.

2 participants