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

HDDS-4264. Uniform naming conventions of Ozone Shell Options. #1447

Merged
merged 2 commits into from
Oct 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hadoop-hdds/docs/content/tools/TestTools.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ bin/ozone freon --help
For example:

```
ozone freon randomkeys --numOfVolumes=10 --numOfBuckets 10 --numOfKeys 10 --replicationType=RATIS --factor=THREE
ozone freon randomkeys --num-of-volumes=10 --num-of-buckets 10 --num-of-keys 10 --replication-type=RATIS --factor=THREE
```

```
Expand Down
2 changes: 1 addition & 1 deletion hadoop-hdds/docs/content/tools/TestTools.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ bin/ozone freon --help
例如:

```
ozone freon randomkeys --numOfVolumes=10 --numOfBuckets 10 --numOfKeys 10 --replicationType=RATIS --factor=THREE
ozone freon randomkeys --num-of-volumes=10 --num-of-buckets 10 --num-of-keys 10 --replication-type=RATIS --factor=THREE
```

```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,17 @@
public class CreatePipelineSubcommand extends ScmSubcommand {

@CommandLine.Option(
names = {"-t", "--replicationType"},
description = "Replication type (STAND_ALONE, RATIS)",
names = {"-t", "--replication-type", "--replicationType"},
description = "Replication type (STAND_ALONE, RATIS). Full name" +
" --replicationType will be removed in later versions.",
defaultValue = "STAND_ALONE"
)
private HddsProtos.ReplicationType type;

@CommandLine.Option(
names = {"-f", "--replicationFactor"},
description = "Replication factor (ONE, THREE)",
names = {"-f", "--replication-factor", "--replicationFactor"},
description = "Replication factor (ONE, THREE). Full name" +
" --replicationFactor will be removed in later versions.",
defaultValue = "ONE"
)
private HddsProtos.ReplicationFactor factor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
containers:
- name: freon
image: "@docker.image@"
args: ["ozone","freon", "rk", "--factor=THREE", "--replicationType=RATIS"]
args: ["ozone","freon", "rk", "--factor=THREE", "--replication-type=RATIS"]
envFrom:
- configMapRef:
name: config
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
- freon
- rk
- --factor=THREE
- --replicationType=RATIS
- --replication-type=RATIS
envFrom:
- configMapRef:
name: config
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
- freon
- rk
- --factor=THREE
- --replicationType=RATIS
- --replication-type=RATIS
envFrom:
- configMapRef:
name: config
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
- freon
- rk
- --factor=THREE
- --replicationType=RATIS
- --replication-type=RATIS
envFrom:
- configMapRef:
name: config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
- freon
- rk
- --factor=THREE
- --replicationType=RATIS
- --replication-type=RATIS
envFrom:
- configMapRef:
name: config
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Set username

*** Test Cases ***
Initiating freon to generate data
${result} = Execute ozone freon randomkeys --numOfVolumes 5 --numOfBuckets 5 --numOfKeys 5 --numOfThreads 1
${result} = Execute ozone freon randomkeys --num-of-volumes 5 --num-of-buckets 5 --num-of-keys 5 --num-of-threads 1
Wait Until Keyword Succeeds 3min 10sec Should contain ${result} Number of Keys added: 125
Should Not Contain ${result} ERROR

Expand Down
2 changes: 1 addition & 1 deletion hadoop-ozone/dist/src/main/smoketest/basic/basic.robot
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ Check webui static resources

Start freon testing
Run Keyword if '${SECURITY_ENABLED}' == 'true' Kinit test user testuser testuser.keytab
${result} = Execute ozone freon randomkeys --numOfVolumes 5 --numOfBuckets 5 --numOfKeys 5 --numOfThreads 1 --replicationType RATIS --factor THREE --validateWrites
${result} = Execute ozone freon randomkeys --num-of-volumes 5 --num-of-buckets 5 --num-of-keys 5 --num-of-threads 1 --replication-type RATIS --factor THREE --validate-writes
Wait Until Keyword Succeeds 3min 10sec Should contain ${result} Number of Keys added: 125
Should Contain ${result} Status: Success
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Test ozone shell
Should contain ${result} creationTime
${result} = Execute ozone sh volume list | jq -r '. | select(.name=="${volume}")'
Should contain ${result} creationTime
# TODO: Disable updating the owner, acls should be used to give access to other user.
# TODO: Disable updating the owner, acls should be used to give access to other user.
Execute ozone sh volume setquota ${protocol}${server}/${volume} --space-quota 10TB --count-quota 100
# ${result} = Execute ozone sh volume info ${protocol}${server}/${volume} | jq -r '. | select(.volumeName=="${volume}") | .owner | .name'
# Should Be Equal ${result} bill
Expand Down
2 changes: 1 addition & 1 deletion hadoop-ozone/dist/src/main/smoketest/freon/freon.robot
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Test Timeout 5 minutes

*** Test Cases ***
Freon Randomkey Generator
${result} = Execute ozone freon rk ${OM_HA_PARAM} --numOfVolumes=1 --numOfBuckets=1 --numOfKeys=1 --numOfThreads=1
${result} = Execute ozone freon rk ${OM_HA_PARAM} --num-of-volumes=1 --num-of-buckets=1 --num-of-keys=1 --num-of-threads=1
Wait Until Keyword Succeeds 3min 10sec Should contain ${result} Number of Keys added: 1

Freon Ozone Key Generator
Expand Down
2 changes: 1 addition & 1 deletion hadoop-ozone/dist/src/main/smoketest/recon/recon-api.robot
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Check if Recon picks up container from OM
*** Test Cases ***
Generate Freon data
Run Keyword if '${SECURITY_ENABLED}' == 'true' Kinit test user testuser testuser.keytab
Execute ozone freon rk --replicationType=RATIS --numOfVolumes 1 --numOfBuckets 1 --numOfKeys 10 --keySize 1025
Execute ozone freon rk --replication-type=RATIS --num-of-volumes 1 --num-of-buckets 1 --num-of-keys 10 --key-size 1025

Check if Recon picks up OM data
Wait Until Keyword Succeeds 90sec 10sec Check if Recon picks up container from OM
Expand Down
2 changes: 1 addition & 1 deletion hadoop-ozone/dist/src/main/smoketest/spnego/web.robot
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Verify SPNEGO enabled URL
*** Test Cases ***
Generate Freon data
Run Keyword if '${SECURITY_ENABLED}' == 'true' Kinit test user testuser testuser.keytab
Execute ozone freon rk --replicationType=RATIS --numOfVolumes 1 --numOfBuckets 1 --numOfKeys 2 --keySize 1025
Execute ozone freon rk --replication-type=RATIS --num-of-volumes 1 --num-of-buckets 1 --num-of-keys 2 --key-size 1025

Test OM portal
Verify SPNEGO enabled URL ${OM_URL}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,37 +52,45 @@ public class TestMiniChaosOzoneCluster extends GenericCli {
static final Logger LOG =
LoggerFactory.getLogger(TestMiniChaosOzoneCluster.class);

@Option(names = {"-d", "--numDatanodes"},
description = "num of datanodes")
@Option(names = {"-d", "--num-datanodes", "--numDatanodes"},
description = "num of datanodes. Full name --numDatanodes will be" +
" removed in later versions.")
private static int numDatanodes = 20;

@Option(names = {"-o", "--numOzoneManager"},
description = "num of ozoneManagers")
@Option(names = {"-o", "--num-ozone-manager", "--numOzoneManager"},
description = "num of ozoneManagers. Full name --numOzoneManager will" +
" be removed in later versions.")
private static int numOzoneManagers = 1;

@Option(names = {"-s", "--failureService"},
description = "service (datanode or ozoneManager) to test chaos on",
@Option(names = {"-s", "--failure-service", "--failureService"},
description = "service (datanode or ozoneManager) to test chaos on. " +
"Full --failureService name will be removed in later versions.",
defaultValue = "datanode")
private static String failureService = "datanode";

@Option(names = {"-t", "--numThreads"},
description = "num of IO threads")
@Option(names = {"-t", "--num-threads", "--numThreads"},
description = "num of IO threads. Full name --numThreads will be" +
" removed in later versions.")
private static int numThreads = 5;

@Option(names = {"-b", "--numBuffers"},
description = "num of IO buffers")
@Option(names = {"-b", "--num-buffers", "--numBuffers"},
description = "num of IO buffers. Full name --numBuffers will be" +
" removed in later versions.")
private static int numBuffers = 16;

@Option(names = {"-m", "--numMinutes"},
description = "total run time")
@Option(names = {"-m", "--num-minutes", "--numMinutes"},
description = "total run time. Full name --numMinutes will be " +
"removed in later versions.")
private static int numMinutes = 1440; // 1 day by default

@Option(names = {"-v", "--numDataVolume"},
description = "number of datanode volumes to create")
@Option(names = {"-v", "--num-data-volume", "--numDataVolume"},
description = "number of datanode volumes to create. Full name " +
"--numDataVolume will be removed in later versions.")
private static int numDataVolumes = 3;

@Option(names = {"-i", "--failureInterval"},
description = "time between failure events in seconds")
@Option(names = {"-i", "--failure-interval", "--failureInterval"},
description = "time between failure events in seconds. Full name " +
"--failureInterval will be removed in later versions.")
private static int failureInterval = 300; // 5 minute period between failures.

private static MiniOzoneChaosCluster cluster;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ def run_freon(self, num_volumes, num_buckets, num_keys, key_size,
"""
command = [Command.freon,
" rk",
" --numOfVolumes " + str(num_volumes),
" --numOfBuckets " + str(num_buckets),
" --numOfKeys " + str(num_keys),
" --keySize " + str(key_size),
" --replicationType " + replication_type,
" --num-of-volumes " + str(num_volumes),
" --num-of-buckets " + str(num_buckets),
" --num-of-keys " + str(num_keys),
" --key-size " + str(key_size),
" --replication-type " + replication_type,
" --factor " + replication_factor]
return util.run_docker_command(command, self.cluster.client)
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,16 @@ public class HadoopDirTreeGenerator extends BaseFreonGenerator
defaultValue = "5")
private int depth;

@Option(names = {"-c", "--fileCount"},
description = "Number of files to be written in each directory",
@Option(names = {"-c", "--file-count", "--fileCount"},
description = "Number of files to be written in each directory. Full" +
" name --fileCount will be removed in later versions.",
defaultValue = "2")
private int fileCount;

@Option(names = {"-g", "--fileSize"},
@Option(names = {"-g", "--file-size", "--fileSize"},
description = "Generated data size(in bytes) of each file to be " +
"written in each directory",
"written in each directory. Full name --fileSize will be removed " +
"in later versions.",
defaultValue = "4096")
private int fileSizeInBytes;

Expand All @@ -81,9 +83,10 @@ public class HadoopDirTreeGenerator extends BaseFreonGenerator
defaultValue = "10")
private int span;

@Option(names = {"-l", "--nameLen"},
@Option(names = {"-l", "--name-len", "--nameLen"},
description =
"Length of the random name of directory you want to create.",
"Length of the random name of directory you want to create. Full " +
"name --nameLen will be removed in later versions.",
defaultValue = "10")
private int length;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ public class HadoopNestedDirGenerator extends BaseFreonGenerator
defaultValue = "10")
private int span;

@Option(names = {"-l", "--nameLen"},
@Option(names = {"-l", "--name-len", "--nameLen"},
description =
"Length of the random name of directory you want to create.",
"Length of the random name of directory you want to create. Full " +
"name --nameLen will be removed in later versions.",
defaultValue = "10")
private int length;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,44 +113,51 @@ enum FreonOps {
private volatile boolean completed = false;
private volatile Throwable exception;

@Option(names = "--numOfThreads",
description = "number of threads to be launched for the run",
@Option(names = {"--num-of-threads", "--numOfThreads"},
description = "number of threads to be launched for the run. Full name " +
"--numOfThreads will be removed in later versions.",
defaultValue = "10")
private int numOfThreads = 10;

@Option(names = "--numOfVolumes",
description = "specifies number of Volumes to be created in offline mode",
@Option(names = {"--num-of-volumes", "--numOfVolumes"},
description = "specifies number of Volumes to be created in offline " +
"mode. Full name --numOfVolumes will be removed in later versions.",
defaultValue = "10")
private int numOfVolumes = 10;

@Option(names = "--numOfBuckets",
description = "specifies number of Buckets to be created per Volume",
@Option(names = {"--num-of-buckets", "--numOfBuckets"},
description = "specifies number of Buckets to be created per Volume. " +
"Full name --numOfBuckets will be removed in later versions.",
defaultValue = "1000")
private int numOfBuckets = 1000;

@Option(
names = "--numOfKeys",
description = "specifies number of Keys to be created per Bucket",
names = {"--num-of-keys", "--numOfKeys"},
description = "specifies number of Keys to be created per Bucket. Full" +
" name --numOfKeys will be removed in later versions.",
defaultValue = "500000"
)
private int numOfKeys = 500000;

@Option(
names = "--keySize",
description = "Specifies the size of Key in bytes to be created",
names = {"--key-size", "--keySize"},
description = "Specifies the size of Key in bytes to be created. Full" +
" name --keySize will be removed in later versions.",
defaultValue = "10240"
)
private long keySize = 10240;

@Option(
names = "--validateWrites",
description = "Specifies whether to validate keys after writing"
names = {"--validate-writes", "--validateWrites"},
description = "Specifies whether to validate keys after writing. Full" +
" name --validateWrites will be removed in later versions."
)
private boolean validateWrites = false;

@Option(
names = "--bufferSize",
description = "Specifies the buffer size while writing",
names = {"--buffer-size", "--bufferSize"},
description = "Specifies the buffer size while writing. Full name " +
"--bufferSize will be removed in later versions.",
defaultValue = "4096"
)
private int bufferSize = 4096;
Expand All @@ -162,8 +169,9 @@ enum FreonOps {
private String jsonDir;

@Option(
names = "--replicationType",
description = "Replication type (STAND_ALONE, RATIS)",
names = {"--replication-type", "--replicationType"},
description = "Replication type (STAND_ALONE, RATIS). Full name " +
"--replicationType will be removed in later versions.",
defaultValue = "STAND_ALONE"
)
private ReplicationType type = ReplicationType.STAND_ALONE;
Expand Down