You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ratis.apache.org by GitBox <gi...@apache.org> on 2020/08/11 12:02:27 UTC

[GitHub] [incubator-ratis] chainho opened a new pull request #178: add start and stop script for Counter example

chainho opened a new pull request #178:
URL: https://github.com/apache/incubator-ratis/pull/178


   ## What changes were proposed in this pull request?
   Hello, 
   I am a new user for Ratis.
   I found that in example module, there is no convenient method to start three Ratis server for testing, user have to specified one by one in terminal or IDE.
   
   So, the scripts can be a handy tool for new user testing.
   Hope it helpful.
   
   Shucheng Hou


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-ratis] amaliujia commented on a change in pull request #178: add start and stop script for Counter example

Posted by GitBox <gi...@apache.org>.
amaliujia commented on a change in pull request #178:
URL: https://github.com/apache/incubator-ratis/pull/178#discussion_r484535831



##########
File path: ratis-examples/src/main/bin/start-counter-server.sh
##########
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+source $DIR/common.sh
+
+# One of the examples, e.g. "filestore" or "arithmetic"
+example="$1"

Review comment:
       It seems might to print a list of examples and then allow user to choose (which should include validation)

##########
File path: ratis-examples/src/main/bin/start-counter-server.sh
##########
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+source $DIR/common.sh
+
+# One of the examples, e.g. "filestore" or "arithmetic"
+example="$1"

Review comment:
       It seems to be better to print a list of examples and then allow user to choose (which should include validation)




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-ratis] amaliujia commented on a change in pull request #178: add start and stop script for Counter example

Posted by GitBox <gi...@apache.org>.
amaliujia commented on a change in pull request #178:
URL: https://github.com/apache/incubator-ratis/pull/178#discussion_r484535994



##########
File path: ratis-examples/src/main/bin/start-counter-server.sh
##########
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+source $DIR/common.sh
+
+# One of the examples, e.g. "filestore" or "arithmetic"
+example="$1"
+shift
+
+subcommand="$1"

Review comment:
       same for subcommand




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-ratis] amaliujia commented on a change in pull request #178: add start and stop script for Counter example

Posted by GitBox <gi...@apache.org>.
amaliujia commented on a change in pull request #178:
URL: https://github.com/apache/incubator-ratis/pull/178#discussion_r488980897



##########
File path: ratis-examples/src/main/bin/stop-counter-server.sh
##########
@@ -0,0 +1,18 @@
+ #!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+ kill $(jps -lv | grep 'ratis' | grep 'CounterServer' | grep -v 'grep' | awk '{print $1}')

Review comment:
       In fact, I think `ratis-examples/src/main/bin./stop-all.sh` will server your stop server purpose.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-ratis] amaliujia commented on a change in pull request #178: add start and stop script for Counter example

Posted by GitBox <gi...@apache.org>.
amaliujia commented on a change in pull request #178:
URL: https://github.com/apache/incubator-ratis/pull/178#discussion_r484536163



##########
File path: ratis-examples/src/main/bin/stop-counter-server.sh
##########
@@ -0,0 +1,18 @@
+ #!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+ kill $(jps -lv | grep 'ratis' | grep 'CounterServer' | grep -v 'grep' | awk '{print $1}')

Review comment:
       Out of curiosity: will this way leave garbages generated by servers locally?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-ratis] amaliujia commented on pull request #178: add start and stop script for Counter example

Posted by GitBox <gi...@apache.org>.
amaliujia commented on pull request #178:
URL: https://github.com/apache/incubator-ratis/pull/178#issuecomment-688458061


   @runzhiwang 
   
   Do you think whether this patch is useful for Ratis?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org