acelyc111 commented on code in PR #1369:
URL: 
https://github.com/apache/incubator-pegasus/pull/1369#discussion_r1133935696


##########
scripts/downgrade_node.sh:
##########
@@ -20,37 +20,58 @@ set -e
 
 PID=$$
 
-if [ $# -ne 4 ]
-then
+function usage()
+{
   echo "This tool is for downgrading replicas of specified node."
-  echo "USAGE: $0 <cluster-meta-list> <node> <app-name> <run|test>"
-  echo "  app-name = * means migrate all apps"
+  echo
+  echo "USAGE1: $0 <cluster-meta-list> <node> <app-name> <run|test>"
+  echo "USAGE2: $0 <shell-config-path> <node> <app-name> <run|test> -f"
+  echo "app-name = * means downgrade all apps"
+}
+
+if [ $# -ne 4 -a $# -ne 5 ]
+then
+  usage
   exit 1
 fi
 
 pwd="$( cd "$( dirname "$0"  )" && pwd )"
 shell_dir="$( cd $pwd/.. && pwd )"
 cd $shell_dir
 
-cluster=$1
+CONFIG_SPECIFIED=0
+if [ $# -eq 4 ]; then
+  cluster=$1
+elif [ "$5" == "-f" ]; then
+  CONFIG_SPECIFIED=1
+  config=$1
+else
+  usage
+  echo "ERROR: invalid option: $5"
+  exit 1
+fi
 node=$2
 app_name=$3
 type=$4
 
 if [ "$type" != "run" -a "$type" != "test" ]
 then
+  usage
   echo "ERROR: invalid type: $type"
-  echo "USAGE: $0 <cluster-meta-list> <node> <app-name> <run|test>"
   exit 1
 fi
 
 echo "UID=$UID"
 echo "PID=$PID"
 echo
 
-echo "set_meta_level steady" | ./run.sh shell --cluster $cluster 
&>/tmp/$UID.$PID.pegasus.set_meta_level
-
-echo ls | ./run.sh shell --cluster $cluster &>/tmp/$UID.$PID.pegasus.ls
+if [ ${CONFIG_SPECIFIED} -eq 0 ]; then

Review Comment:
   `CONFIG_SPECIFIED` can be replaced by `cluster`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to