You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/01/28 15:35:03 UTC
[GitHub] [ignite] anton-vinogradov opened a new pull request #9779: IGNITE-16225 Read Repair control.sh command should have named params
anton-vinogradov opened a new pull request #9779:
URL: https://github.com/apache/ignite/pull/9779
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
### The Contribution Checklist
- [ ] There is a single JIRA ticket related to the pull request.
- [ ] The web-link to the pull request is attached to the JIRA ticket.
- [ ] The JIRA ticket has the _Patch Available_ state.
- [ ] The pull request body describes changes that have been made.
The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
- [ ] The pull request title is treated as the final commit message.
The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
- [ ] A reviewer has been mentioned through the JIRA comments
(see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers))
- [ ] The pull request has been checked by the Teamcity Bot and
the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
### Notes
- [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
- [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
- [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
- [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] anton-vinogradov commented on a change in pull request #9779: IGNITE-16225 Read Repair control.sh command should have named params
Posted by GitBox <gi...@apache.org>.
anton-vinogradov commented on a change in pull request #9779:
URL: https://github.com/apache/ignite/pull/9779#discussion_r795701119
##########
File path: modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/consistency/ConsistencyCommand.java
##########
@@ -132,10 +150,48 @@
cmd = of(argIter.nextArg("Expected consistency action."));
if (cmd == REPAIR) {
- String cacheName = argIter.nextArg("Expected cache name.");
- int part = argIter.nextNonNegativeIntArg("Expected partition.");
+ String cacheName = null;
+ int part = -1;
+ ReadRepairStrategy strategy = null;
+
+ while (argIter.hasNextArg()) {
+ String arg = argIter.peekNextArg();
+
+ if (C.equals(arg) || CACHE.equals(arg) ||
+ P.equals(arg) || PARTITION.equals(arg) ||
+ S.equals(arg) || STRATEGY.equals(arg)) {
+ arg = argIter.nextArg("Expected parameter key.");
+
+ switch (arg) {
+ case C:
+ case CACHE:
+ cacheName = argIter.nextArg("Expected cache name.");
+
+ break;
+
+ case P:
+ case PARTITION:
+ part = argIter.nextNonNegativeIntArg("Expected partition.");
+
+ break;
+
+ case S:
+ case STRATEGY:
+ strategy = ReadRepairStrategy.fromString(argIter.nextArg("Expected strategy."));
+
+ break;
+
+ default:
+ throw new IllegalArgumentException("Illegal argument: " + arg);
+ }
+ }
+ else
+ break;
+ }
- ReadRepairStrategy strategy = ReadRepairStrategy.fromString(argIter.nextArg("Expected strategy."));
+ assert cacheName != null;
Review comment:
Done
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] timoninmaxim commented on a change in pull request #9779: IGNITE-16225 Read Repair control.sh command should have named params
Posted by GitBox <gi...@apache.org>.
timoninmaxim commented on a change in pull request #9779:
URL: https://github.com/apache/ignite/pull/9779#discussion_r795696672
##########
File path: modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/consistency/ConsistencyCommand.java
##########
@@ -43,6 +43,24 @@
*
*/
public class ConsistencyCommand extends AbstractCommand<Object> {
+ /** Cache. */
+ public static final String C = "-c";
+
+ /** Cache. */
+ public static final String CACHE = "--cache";
Review comment:
OK, but it's sad :(
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] timoninmaxim commented on a change in pull request #9779: IGNITE-16225 Read Repair control.sh command should have named params
Posted by GitBox <gi...@apache.org>.
timoninmaxim commented on a change in pull request #9779:
URL: https://github.com/apache/ignite/pull/9779#discussion_r795695907
##########
File path: modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/consistency/ConsistencyCommand.java
##########
@@ -43,6 +43,24 @@
*
*/
public class ConsistencyCommand extends AbstractCommand<Object> {
+ /** Cache. */
+ public static final String C = "-c";
Review comment:
IMHO, it's useful for commands that run frequently in console and frequently used with combination of multiple options, like `tar -cvf`, or `ls -lrt`, or `grep -HIi`.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] anton-vinogradov merged pull request #9779: IGNITE-16225 Read Repair control.sh command should have named params
Posted by GitBox <gi...@apache.org>.
anton-vinogradov merged pull request #9779:
URL: https://github.com/apache/ignite/pull/9779
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] anton-vinogradov commented on a change in pull request #9779: IGNITE-16225 Read Repair control.sh command should have named params
Posted by GitBox <gi...@apache.org>.
anton-vinogradov commented on a change in pull request #9779:
URL: https://github.com/apache/ignite/pull/9779#discussion_r795676513
##########
File path: modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/consistency/ConsistencyCommand.java
##########
@@ -43,6 +43,24 @@
*
*/
public class ConsistencyCommand extends AbstractCommand<Object> {
+ /** Cache. */
+ public static final String C = "-c";
Review comment:
Why not?
This is useful! Let me be the first! :)
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] timoninmaxim commented on a change in pull request #9779: IGNITE-16225 Read Repair control.sh command should have named params
Posted by GitBox <gi...@apache.org>.
timoninmaxim commented on a change in pull request #9779:
URL: https://github.com/apache/ignite/pull/9779#discussion_r795438387
##########
File path: modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/consistency/ConsistencyCommand.java
##########
@@ -43,6 +43,24 @@
*
*/
public class ConsistencyCommand extends AbstractCommand<Object> {
+ /** Cache. */
+ public static final String C = "-c";
Review comment:
As I can see, Ignite doesn't support shortened params for any commands in the control utility. Some operations use the full "--cache" param, but no one uses the "-c" param. Let's do it similarly.
##########
File path: modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/consistency/ConsistencyCommand.java
##########
@@ -132,10 +150,48 @@
cmd = of(argIter.nextArg("Expected consistency action."));
if (cmd == REPAIR) {
- String cacheName = argIter.nextArg("Expected cache name.");
- int part = argIter.nextNonNegativeIntArg("Expected partition.");
+ String cacheName = null;
+ int part = -1;
+ ReadRepairStrategy strategy = null;
+
+ while (argIter.hasNextArg()) {
+ String arg = argIter.peekNextArg();
+
+ if (C.equals(arg) || CACHE.equals(arg) ||
+ P.equals(arg) || PARTITION.equals(arg) ||
+ S.equals(arg) || STRATEGY.equals(arg)) {
+ arg = argIter.nextArg("Expected parameter key.");
+
+ switch (arg) {
+ case C:
+ case CACHE:
+ cacheName = argIter.nextArg("Expected cache name.");
+
+ break;
+
+ case P:
+ case PARTITION:
+ part = argIter.nextNonNegativeIntArg("Expected partition.");
+
+ break;
+
+ case S:
+ case STRATEGY:
+ strategy = ReadRepairStrategy.fromString(argIter.nextArg("Expected strategy."));
+
+ break;
+
+ default:
+ throw new IllegalArgumentException("Illegal argument: " + arg);
+ }
+ }
+ else
+ break;
+ }
- ReadRepairStrategy strategy = ReadRepairStrategy.fromString(argIter.nextArg("Expected strategy."));
+ assert cacheName != null;
Review comment:
Why assert? Let's throw a `IllegalArgumentException` here.
##########
File path: modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/consistency/ConsistencyCommand.java
##########
@@ -43,6 +43,24 @@
*
*/
public class ConsistencyCommand extends AbstractCommand<Object> {
+ /** Cache. */
+ public static final String C = "-c";
+
+ /** Cache. */
+ public static final String CACHE = "--cache";
Review comment:
Other commands uses enums for list of params. Let's do it in the same way.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] anton-vinogradov commented on a change in pull request #9779: IGNITE-16225 Read Repair control.sh command should have named params
Posted by GitBox <gi...@apache.org>.
anton-vinogradov commented on a change in pull request #9779:
URL: https://github.com/apache/ignite/pull/9779#discussion_r795704229
##########
File path: modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/consistency/ConsistencyCommand.java
##########
@@ -43,6 +43,24 @@
*
*/
public class ConsistencyCommand extends AbstractCommand<Object> {
+ /** Cache. */
+ public static final String C = "-c";
Review comment:
It's really harder to ake type at `P` than at `PARTITION`.
Also, the command is shorter, which is important.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] anton-vinogradov commented on a change in pull request #9779: IGNITE-16225 Read Repair control.sh command should have named params
Posted by GitBox <gi...@apache.org>.
anton-vinogradov commented on a change in pull request #9779:
URL: https://github.com/apache/ignite/pull/9779#discussion_r795704229
##########
File path: modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/consistency/ConsistencyCommand.java
##########
@@ -43,6 +43,24 @@
*
*/
public class ConsistencyCommand extends AbstractCommand<Object> {
+ /** Cache. */
+ public static final String C = "-c";
Review comment:
It's really harder to make type at `P` than at `PARTITION`.
Also, the command is shorter, which is important.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] anton-vinogradov commented on a change in pull request #9779: IGNITE-16225 Read Repair control.sh command should have named params
Posted by GitBox <gi...@apache.org>.
anton-vinogradov commented on a change in pull request #9779:
URL: https://github.com/apache/ignite/pull/9779#discussion_r795704229
##########
File path: modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/consistency/ConsistencyCommand.java
##########
@@ -43,6 +43,24 @@
*
*/
public class ConsistencyCommand extends AbstractCommand<Object> {
+ /** Cache. */
+ public static final String C = "-c";
Review comment:
It's really harder to make typo at `P` than at `PARTITION`.
Also, the command is shorter, which is important.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] anton-vinogradov commented on a change in pull request #9779: IGNITE-16225 Read Repair control.sh command should have named params
Posted by GitBox <gi...@apache.org>.
anton-vinogradov commented on a change in pull request #9779:
URL: https://github.com/apache/ignite/pull/9779#discussion_r795681045
##########
File path: modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/consistency/ConsistencyCommand.java
##########
@@ -132,10 +150,48 @@
cmd = of(argIter.nextArg("Expected consistency action."));
if (cmd == REPAIR) {
- String cacheName = argIter.nextArg("Expected cache name.");
- int part = argIter.nextNonNegativeIntArg("Expected partition.");
+ String cacheName = null;
+ int part = -1;
+ ReadRepairStrategy strategy = null;
+
+ while (argIter.hasNextArg()) {
+ String arg = argIter.peekNextArg();
+
+ if (C.equals(arg) || CACHE.equals(arg) ||
+ P.equals(arg) || PARTITION.equals(arg) ||
+ S.equals(arg) || STRATEGY.equals(arg)) {
+ arg = argIter.nextArg("Expected parameter key.");
+
+ switch (arg) {
+ case C:
+ case CACHE:
+ cacheName = argIter.nextArg("Expected cache name.");
+
+ break;
+
+ case P:
+ case PARTITION:
+ part = argIter.nextNonNegativeIntArg("Expected partition.");
+
+ break;
+
+ case S:
+ case STRATEGY:
+ strategy = ReadRepairStrategy.fromString(argIter.nextArg("Expected strategy."));
+
+ break;
+
+ default:
+ throw new IllegalArgumentException("Illegal argument: " + arg);
+ }
+ }
+ else
+ break;
+ }
- ReadRepairStrategy strategy = ReadRepairStrategy.fromString(argIter.nextArg("Expected strategy."));
+ assert cacheName != null;
Review comment:
At least some of the commands are strings:
ClusterStateChangeCommand#FORCE_COMMAND
DefragmentationCommand#NODES_ARG
WalCommands#WAL_PRINT
...
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] anton-vinogradov commented on a change in pull request #9779: IGNITE-16225 Read Repair control.sh command should have named params
Posted by GitBox <gi...@apache.org>.
anton-vinogradov commented on a change in pull request #9779:
URL: https://github.com/apache/ignite/pull/9779#discussion_r795681267
##########
File path: modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/consistency/ConsistencyCommand.java
##########
@@ -43,6 +43,24 @@
*
*/
public class ConsistencyCommand extends AbstractCommand<Object> {
+ /** Cache. */
+ public static final String C = "-c";
+
+ /** Cache. */
+ public static final String CACHE = "--cache";
Review comment:
At least some of the commands are strings:
ClusterStateChangeCommand#FORCE_COMMAND
DefragmentationCommand#NODES_ARG
WalCommands#WAL_PRINT
...
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org