From 83dbd1d17f903bdf852d1536a28a8d97ebb3bb80 Mon Sep 17 00:00:00 2001 From: Sarveksha Yeshavantha Raju <79865743+sarvekshayr@users.noreply.github.com> Date: Fri, 12 Apr 2024 14:01:43 +0530 Subject: [PATCH] HDDS-1056. Remove Standalone as the replication type in Ozone client api. (#6466) --- .../pipeline/CreatePipelineSubcommand.java | 10 ++++---- .../main/smoketest/admincli/pipeline.robot | 24 ++++++++----------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/pipeline/CreatePipelineSubcommand.java b/hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/pipeline/CreatePipelineSubcommand.java index 86299eec2d0..209acd32230 100644 --- a/hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/pipeline/CreatePipelineSubcommand.java +++ b/hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/pipeline/CreatePipelineSubcommand.java @@ -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" ) @@ -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."); } diff --git a/hadoop-ozone/dist/src/main/smoketest/admincli/pipeline.robot b/hadoop-ozone/dist/src/main/smoketest/admincli/pipeline.robot index c35cb7f53d3..d81d0ea1a66 100644 --- a/hadoop-ozone/dist/src/main/smoketest/admincli/pipeline.robot +++ b/hadoop-ozone/dist/src/main/smoketest/admincli/pipeline.robot @@ -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}" @@ -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