Skip to content

Commit 8e60597

Browse files
HDDS-7956. Deprecate camelCase and under_score style long options (#10495)
1 parent e596681 commit 8e60597

30 files changed

Lines changed: 97 additions & 87 deletions

File tree

hadoop-hdds/cli-common/src/main/java/org/apache/hadoop/hdds/cli/DeprecatedCliOption.java

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
import java.util.Objects;
2424

2525
/**
26-
* Emits warnings when deprecated multi-character short CLI options are used.
26+
* Emits warnings when deprecated CLI option aliases are used
27+
* and return the recommended replacement option.
2728
*/
2829
public final class DeprecatedCliOption {
2930

@@ -47,6 +48,35 @@ private static Map<String, String> buildDeprecatedOptions() {
4748
options.put("-tact", "--transaction-apply-check-interval");
4849
options.put("-pct", "--prepare-check-interval");
4950
options.put("-pt", "--prepare-timeout");
51+
options.put("--accessId", "--access-id");
52+
options.put("--bufferSize", "--buffer-size");
53+
options.put("--column_family", "--column-family");
54+
options.put("--dnSchema", "--dn-schema");
55+
options.put("--expectedGeneration", "--expected-generation");
56+
options.put("--fileCount", "--file-count");
57+
options.put("--fileSize", "--file-size");
58+
options.put("--filterByFactor", "--filter-by-factor");
59+
options.put("--filterByState", "--filter-by-state");
60+
options.put("--keySize", "--key-size");
61+
options.put("--maxDatanodesPercentageToInvolvePerIteration",
62+
"--max-datanodes-percentage-to-involve-per-iteration");
63+
options.put("--maxSizeEnteringTargetInGB", "--max-size-entering-target-in-gb");
64+
options.put("--maxSizeLeavingSourceInGB", "--max-size-leaving-source-in-gb");
65+
options.put("--maxSizeToMovePerIterationInGB", "--max-size-to-move-per-iteration-in-gb");
66+
options.put("--nameLen", "--name-len");
67+
options.put("--newLeaderId", "--new-leader-id");
68+
options.put("--numOfBuckets", "--num-of-buckets");
69+
options.put("--numOfKeys", "--num-of-keys");
70+
options.put("--numOfThreads", "--num-of-threads");
71+
options.put("--numOfValidateThreads", "--num-of-validate-threads");
72+
options.put("--numOfVolumes", "--num-of-volumes");
73+
options.put("--onlyFileNames", "--only-file-names");
74+
options.put("--replicationFactor", "--replication-factor");
75+
options.put("--replicationType", "--replication-type");
76+
options.put("--scmHost", "--scm-host");
77+
options.put("--secretKey", "--secret");
78+
options.put("--segmentPath", "--segment-path");
79+
options.put("--validateWrites", "--validate-writes");
5080
return options;
5181
}
5282

hadoop-hdds/docs/content/feature/ContainerBalancer.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ ozone admin containerbalancer start [options]
5353
|-------------------------------------------------------| -------------------------------------------------------------------------------------------------------------------------------------- |
5454
| `-t`, `--threshold` | The percentage deviation from the average utilization of the cluster after which a datanode will be rebalanced. Default is 10%. |
5555
| `-i`, `--iterations` | The maximum number of consecutive iterations the balancer will run for. Default is 10. Use -1 for infinite iterations. |
56-
| `-d`, `--maxDatanodesPercentageToInvolvePerIteration` | The maximum percentage of healthy, in-service datanodes that can be involved in balancing in one iteration. Default is 20%. |
57-
| `-s`, `--maxSizeToMovePerIterationInGB` | The maximum size of data in GB to be moved in one iteration. Default is 500GB. |
58-
| `-e`, `--maxSizeEnteringTargetInGB` | The maximum size in GB that can enter a target datanode in one iteration. Default is 26GB. |
59-
| `-l`, `--maxSizeLeavingSourceInGB` | The maximum size in GB that can leave a source datanode in one iteration. Default is 26GB. |
56+
| `-d`, `--max-datanodes-percentage-to-involve-per-iteration` | The maximum percentage of healthy, in-service datanodes that can be involved in balancing in one iteration. Default is 20%. |
57+
| `-s`, `--max-size-to-move-per-iteration-in-gb` | The maximum size of data in GB to be moved in one iteration. Default is 500GB. |
58+
| `-e`, `--max-size-entering-target-in-gb` | The maximum size in GB that can enter a target datanode in one iteration. Default is 26GB. |
59+
| `-l`, `--max-size-leaving-source-in-gb` | The maximum size in GB that can leave a source datanode in one iteration. Default is 26GB. |
6060
| `--balancing-iteration-interval-minutes` | The interval in minutes between each iteration of the Container Balancer. Default is 70 minutes. |
6161
| `--move-timeout-minutes` | The time in minutes to allow a single container to move from source to target. Default is 65 minutes. |
6262
| `--move-replication-timeout-minutes` | The time in minutes to allow a single container's replication from source to target as part of a container move. Default is 50 minutes. |

hadoop-hdds/docs/content/feature/OM-HA.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ ozone admin om transfer -id <OM_SERVICE_ID> -r
137137
```
138138

139139
* `-id, --service-id`: Specifies the Ozone Manager Service ID.
140-
* `-n, --newLeaderId, --new-leader-id`: The node ID of the OM to which leadership will be transferred (e.g., `om1`).
140+
* `-n, --new-leader-id`: The node ID of the OM to which leadership will be transferred (e.g., `om1`).
141141
* `-r, --random`: Randomly chooses a follower to transfer leadership to.
142142

143143
### Example

hadoop-hdds/docs/content/feature/SCM-HA.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ ozone admin scm transfer -id <SCM_SERVICE_ID> -r
104104
```
105105

106106
* `-id, --service-id`: Specifies the SCM Service ID.
107-
* `-n, --newLeaderId, --new-leader-id`: The SCM UUID (Raft peer ID) of the SCM to which leadership will be transferred (e.g., `e6877ce5-56cd-4f0b-ad60-4c8ef9000882`).
107+
* `-n, --new-leader-id`: The SCM UUID (Raft peer ID) of the SCM to which leadership will be transferred (e.g., `e6877ce5-56cd-4f0b-ad60-4c8ef9000882`).
108108
* `-r, --random`: Randomly chooses a follower to transfer leadership to.
109109

110110
### Example
@@ -291,7 +291,7 @@ layoutVersion=0
291291
You can also create data and double check with `ozone debug` tool if all the container metadata is replicated.
292292

293293
```shell
294-
bin/ozone freon randomkeys --numOfVolumes=1 --numOfBuckets=1 --numOfKeys=10000 --keySize=524288 --replicationType=RATIS --numOfThreads=8 --factor=THREE --bufferSize=1048576
294+
bin/ozone freon randomkeys --num-of-volumes=1 --num-of-buckets=1 --num-of-keys=10000 --key-size=524288 --type=RATIS --num-of-threads=8 --factor=THREE --buffer-size=1048576
295295

296296

297297
# use debug ldb to check scm.db on all the machines

hadoop-hdds/docs/content/feature/SCM-HA.zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ layoutVersion=0
191191
如果所有的容器元数据都已复制,您还可以创建数据并使用 `ozone debug` 工具进行双重检查。
192192

193193
```shell
194-
bin/ozone freon randomkeys --numOfVolumes=1 --numOfBuckets=1 --numOfKeys=10000 --keySize=524288 --replicationType=RATIS --numOfThreads=8 --factor=THREE --bufferSize=1048576
194+
bin/ozone freon randomkeys --num-of-volumes=1 --num-of-buckets=1 --num-of-keys=10000 --key-size=524288 --type=RATIS --num-of-threads=8 --factor=THREE --buffer-size=1048576
195195

196196

197197
# 使用 debug ldb 工具逐一检查各机上的 scm.db

hadoop-hdds/docs/content/tools/Repair.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ CLI to compact a column-family in the DB while the service is offline.
6565
Note: If om.db is compacted with this tool then it will negatively impact the
6666
Ozone Manager\'s efficient snapshot diff. The corresponding OM, SCM or Datanode
6767
role should be stopped for this tool.
68-
--cf, --column-family, --column_family=<columnFamilyName>
68+
--cf, --column-family=<columnFamilyName>
6969
Column family name
7070
--db=<dbPath> Database File Path
7171
```
@@ -189,7 +189,7 @@ Usage: ozone repair om compact [-hV] [--dry-run] [--force] [--verbose]
189189
[--service-id=<omServiceId>]
190190
CLI to compact a column family in the om.db. The compaction happens
191191
asynchronously. Requires admin privileges. OM should be running for this tool.
192-
--cf, --column-family, --column_family=<columnFamilyName>
192+
--cf, --column-family=<columnFamilyName>
193193
Column family name
194194
--node-id=<nodeId> NodeID of the OM for which db needs to be compacted.
195195
--service-id, --om-service-id=<omServiceId>

hadoop-hdds/docs/content/tools/debug/Ldb.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ Usage: ozone debug ldb scan [--compact] [--count] [--with-keys]
7474
Parse specified metadataTable
7575
--batch-size=<batchSize>
7676
Batch size for processing DB data.
77-
--cf, --column_family, --column-family=<tableName>
77+
--cf, --column-family=<tableName>
7878
Table name
7979
--cid, --container-id=<containerId>
8080
Container ID. Applicable if datanode DB Schema is V3
8181
--compact disable the pretty print the output
8282
--count, --show-count
8383
Get estimated key count for the given DB column family
8484
Default: false
85-
-d, --dnSchema, --dn-schema=<dnDBSchemaVersion>
85+
-d, --dn-schema=<dnDBSchemaVersion>
8686
Datanode DB Schema Version: V1/V2/V3
8787
-e, --ek, --endkey=<endKey>
8888
Key at which iteration of the DB ends

hadoop-hdds/docs/content/tools/debug/Ldb.zh.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,15 @@ Usage: ozone debug ldb scan [--compact] [--count] [--with-keys]
101101
Parse specified metadataTable
102102
--batch-size=<batchSize>
103103
Batch size for processing DB data.
104-
--cf, --column_family, --column-family=<tableName>
104+
--cf, --column-family=<tableName>
105105
Table name
106106
--cid, --container-id=<containerId>
107107
Container ID. Applicable if datanode DB Schema is V3
108108
--compact disable the pretty print the output
109109
--count, --show-count
110110
Get estimated key count for the given DB column family
111111
Default: false
112-
-d, --dnSchema, --dn-schema=<dnDBSchemaVersion>
112+
-d, --dn-schema=<dnDBSchemaVersion>
113113
Datanode DB Schema Version: V1/V2/V3
114114
-e, --ek, --endkey=<endKey>
115115
Key at which iteration of the DB ends

hadoop-hdds/docs/content/tools/debug/RatisLogParser.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Shell for printing Ratis Log in understandable text
3030
-h, --help Show this help message and exit.
3131
--role=<role> Component role for parsing. Values: om, scm, datanode
3232
Default: generic
33-
-s, --segmentPath, --segment-path=<segmentFile>
33+
-s, --segment-path=<segmentFile>
3434
Path of the segment file
3535
-V, --version Print version information and exit.
3636
--verbose More verbose output. Show the stack trace of the errors.

hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/ContainerBalancerCommands.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
* ozone admin containerbalancer start
3737
* [ -t/--threshold {@literal <threshold>}]
3838
* [ -i/--iterations {@literal <iterations>}]
39-
* [ -d/--maxDatanodesPercentageToInvolvePerIteration
39+
* [ -d/--max-datanodes-percentage-to-involve-per-iteration
4040
* {@literal <maxDatanodesPercentageToInvolvePerIteration>}]
41-
* [ -s/--maxSizeToMovePerIterationInGB
41+
* [ -s/--max-size-to-move-per-iteration-in-gb
4242
* {@literal <maxSizeToMovePerIterationInGB>}]
4343
* Examples:
4444
* ozone admin containerbalancer start

0 commit comments

Comments
 (0)