Skip to content

Commit

Permalink
HDDS-1056. Remove Standalone as the replication type in Ozone client …
Browse files Browse the repository at this point in the history
…api. (apache#6466)
  • Loading branch information
sarvekshayr authored Apr 12, 2024
1 parent c1b27a8 commit 83dbd1d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,16 @@ public class CreatePipelineSubcommand extends ScmSubcommand {

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

@CommandLine.Option(
names = {"-f", "--replication-factor", "--replicationFactor"},
description = "Replication factor (ONE, THREE). Full name" +
description = "Replication factor for RATIS (ONE, THREE). Full name" +
" --replicationFactor will be removed in later versions.",
defaultValue = "ONE"
)
Expand All @@ -62,7 +63,8 @@ public void execute(ScmClient scmClient) throws IOException {
// As I see there is no way to specify ECReplicationConfig properly here
// so failing the request if type is EC, seems to be safe.
if (type == HddsProtos.ReplicationType.CHAINED
|| type == HddsProtos.ReplicationType.EC) {
|| type == HddsProtos.ReplicationType.EC
|| type == HddsProtos.ReplicationType.STAND_ALONE) {
throw new IllegalArgumentException(type.name()
+ " is not supported yet.");
}
Expand Down
24 changes: 10 additions & 14 deletions hadoop-ozone/dist/src/main/smoketest/admincli/pipeline.robot
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,22 @@ ${PIPELINE}
${SCM} scm

*** Test Cases ***
Create pipeline
${output} = Execute ozone admin pipeline create
Should contain ${output} is created.
Should contain ${output} STANDALONE/ONE
${pipeline} = Execute echo "${output}" | grep 'is created' | cut -f1 -d' ' | cut -f2 -d'='
Set Suite Variable ${PIPELINE} ${pipeline}

List pipelines
${output} = Execute ozone admin pipeline list
Should contain ${output} STANDALONE/ONE
Should contain ${output} RATIS/ONE
${pipeline} = Execute ozone admin pipeline list | grep 'ReplicationConfig: RATIS/ONE' | head -n 1 | cut -d' ' -f3 | sed 's/,$//'
Set Suite Variable ${PIPELINE} ${pipeline}

List pipeline with json option
${output} = Execute ozone admin pipeline list --json | jq 'map(.replicationConfig) | contains([{"replicationFactor": "ONE", "replicationType": "STANDALONE"}])'

${output} = Execute ozone admin pipeline list --json | jq 'map(.replicationConfig) | contains([{"replicationFactor": "ONE", "replicationType": "RATIS"}])'
Should be true $output

List pipelines with explicit host
${output} = Execute ozone admin pipeline list --scm ${SCM}
Should contain ${output} STANDALONE/ONE
Should contain ${output} RATIS/ONE

List pipelines with explicit host and json option
${output} = Execute ozone admin pipeline list --scm ${SCM} --json | jq 'map(.replicationConfig) | contains([{"replicationFactor": "ONE", "replicationType": "STANDALONE"}])'

Should be true $output
${output} = Execute ozone admin pipeline list --scm ${SCM} --json | jq 'map(.replicationConfig) | contains([{"replicationFactor": "ONE", "replicationType": "RATIS"}])'

Deactivate pipeline
Execute ozone admin pipeline deactivate "${PIPELINE}"
Expand All @@ -74,6 +66,10 @@ Incomplete command
Should contain ${output} deactivate
Should contain ${output} list

Create pipeline
${output} = Execute And Ignore Error ozone admin pipeline create -t RATIS -f ONE
Should Contain Any ${output} is created. RATIS/ONE Cannot create pipeline

#List pipelines on unknown host
# ${output} = Execute And Ignore Error ozone admin --verbose pipeline list --scm unknown-host
# Should contain ${output} Invalid host name

0 comments on commit 83dbd1d

Please sign in to comment.