Mmuzaf commented on code in PR #2497: URL: https://github.com/apache/cassandra/pull/2497#discussion_r2198151790
########## src/java/org/apache/cassandra/tools/nodetool/Flush.java: ########## @@ -17,24 +17,35 @@ */ package org.apache.cassandra.tools.nodetool; -import io.airlift.airline.Arguments; -import io.airlift.airline.Command; - import java.util.ArrayList; import java.util.List; import org.apache.cassandra.tools.NodeProbe; -import org.apache.cassandra.tools.NodeTool.NodeToolCmd; +import org.apache.cassandra.tools.nodetool.layout.CassandraUsage; +import picocli.CommandLine.Command; +import picocli.CommandLine.Parameters; + +import static org.apache.cassandra.tools.nodetool.CommandUtils.parseOptionalKeyspace; +import static org.apache.cassandra.tools.nodetool.CommandUtils.parseOptionalTables; +import static org.apache.cassandra.tools.nodetool.CommandUtils.concatArgs; @Command(name = "flush", description = "Flush one or more tables") -public class Flush extends NodeToolCmd +public class Flush extends AbstractCommand { - @Arguments(usage = "[<keyspace> <tables>...]", description = "The keyspace followed by one or many tables") + @CassandraUsage(usage = "[<keyspace> <tables>...]", description = "The keyspace followed by one or many tables") private List<String> args = new ArrayList<>(); + @Parameters(index = "0", description = "The keyspace followed by one or many tables to flush", arity = "0..1") + private String keyspace; + + @Parameters(index = "1..*", description = "The tables to flush", arity = "0..1") Review Comment: Fixed. ########## src/java/org/apache/cassandra/tools/nodetool/ForceCompact.java: ########## @@ -18,26 +18,37 @@ package org.apache.cassandra.tools.nodetool; -import io.airlift.airline.Arguments; -import io.airlift.airline.Command; - import java.util.ArrayList; import java.util.List; import org.apache.cassandra.tools.NodeProbe; -import org.apache.cassandra.tools.NodeTool.NodeToolCmd; +import org.apache.cassandra.tools.nodetool.layout.CassandraUsage; +import picocli.CommandLine.Command; +import picocli.CommandLine.Parameters; import static com.google.common.base.Preconditions.checkArgument; +import static org.apache.cassandra.tools.nodetool.CommandUtils.parsePartitionKeys; +import static org.apache.cassandra.tools.nodetool.CommandUtils.concatArgs; @Command(name = "forcecompact", description = "Force a (major) compaction on a table") -public class ForceCompact extends NodeToolCmd +public class ForceCompact extends AbstractCommand { - @Arguments(usage = "[<keyspace> <table> <keys>]", description = "The keyspace, table, and a list of partition keys ignoring the gc_grace_seconds") + @CassandraUsage(usage = "[<keyspace> <table> <keys>]", description = "The keyspace, table, and a list of partition keys ignoring the gc_grace_seconds") private List<String> args = new ArrayList<>(); + @Parameters(index = "0", description = "The keyspace name to compact", arity = "0..1") + private String keyspace; + + @Parameters(index = "1", description = "The table name to compact", arity = "0..1") + private String table; + + @Parameters(index = "2..*", description = "The partition keys to compact", arity = "0..1") Review Comment: Fixed. -- 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: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org