src/java/org/apache/cassandra/tools/NodeCmd.java
/**
     * Prints usage information to stdout.
     */
Prints usage information to stdout.
Prints usage information to stdout .
private static void printUsage()
    {
        HelpFormatter hf = new HelpFormatter();
        StringBuilder header = new StringBuilder();
        header.append("\nAvailable commands:\n");
        addCmdHelp(header, "ring", "Print informations on the token ring");
        addCmdHelp(header, "join", "Join the ring");
        addCmdHelp(header, "info", "Print node informations (uptime, load, ...)");
        addCmdHelp(header, "cfstats", "Print statistics on column families");
        addCmdHelp(header, "version", "Print cassandra version");
        addCmdHelp(header, "tpstats", "Print usage statistics of thread pools");
        addCmdHelp(header, "drain", "Drain the node (stop accepting writes and flush all column families)");
        addCmdHelp(header, "decommission", "Decommission the node");
        addCmdHelp(header, "compactionstats", "Print statistics on compactions");
        addCmdHelp(header, "disablegossip", "Disable gossip (effectively marking the node dead)");
        addCmdHelp(header, "enablegossip", "Reenable gossip");
        addCmdHelp(header, "disablethrift", "Disable thrift server");
        addCmdHelp(header, "enablethrift", "Reenable thrift server");
        addCmdHelp(header, "statusthrift", "Status of thrift server");
        addCmdHelp(header, "gossipinfo", "Shows the gossip information for the cluster");
        addCmdHelp(header, "invalidatekeycache", "Invalidate the key cache");
        addCmdHelp(header, "invalidaterowcache", "Invalidate the row cache");
        addCmdHelp(header, "netstats [host]", "Print network information on provided host (connecting node by default)");
        addCmdHelp(header, "move <new token>", "Move node on the token ring to a new token");
        addCmdHelp(header, "removetoken status|force|<token>", "Show status of current token removal, force completion of pending removal or remove providen token");
        addCmdHelp(header, "setcompactionthroughput <value_in_mb>", "Set the MB/s throughput cap for compaction in the system, or 0 to disable throttling.");
        addCmdHelp(header, "setstreamthroughput <value_in_mb>", "Set the MB/s throughput cap for streaming in the system, or 0 to disable throttling.");
        addCmdHelp(header, "describering [keyspace]", "Shows the token ranges info of a given keyspace.");
        addCmdHelp(header, "snapshot [keyspaces...] -t [snapshotName]", "Take a snapshot of the specified keyspaces using optional name snapshotName");
        addCmdHelp(header, "clearsnapshot [keyspaces...] -t [snapshotName]", "Remove snapshots for the specified keyspaces. Either remove all snapshots or remove the snapshots with the given name.");
        addCmdHelp(header, "flush [keyspace] [cfnames]", "Flush one or more column family");
        addCmdHelp(header, "repair [keyspace] [cfnames]", "Repair one or more column family (use -rp to repair only the first range returned by the partitioner)");
        addCmdHelp(header, "cleanup [keyspace] [cfnames]", "Run cleanup on one or more column family");
        addCmdHelp(header, "compact [keyspace] [cfnames]", "Force a (major) compaction on one or more column family");
        addCmdHelp(header, "scrub [keyspace] [cfnames]", "Scrub (rebuild sstables for) one or more column family");
        addCmdHelp(header, "upgradesstables [keyspace] [cfnames]", "Scrub (rebuild sstables for) one or more column family");
        addCmdHelp(header, "getcompactionthreshold <keyspace> <cfname>", "Print min and max compaction thresholds for a given column family");
        addCmdHelp(header, "cfhistograms <keyspace> <cfname>", "Print statistic histograms for a given column family");
        addCmdHelp(header, "refresh <keyspace> <cf-name>", "Load newly placed SSTables to the system without restart.");
        addCmdHelp(header, "getendpoints <keyspace> <cf> <key>", "Print the end points that owns the key");
        addCmdHelp(header, "setcachecapacity <keyspace> <cfname> <keycachecapacity> <rowcachecapacity>", "Set the key and row cache capacities of a given column family");
        addCmdHelp(header, "setcompactionthreshold <keyspace> <cfname> <minthreshold> <maxthreshold>", "Set the min and max compaction thresholds for a given column family");
        addCmdHelp(header, "stop <compaction_type>", "Supported types are COMPACTION, VALIDATION, CLEANUP, SCRUB, INDEX_BUILD");
        String usage = String.format("java %s --host <arg> <command>%n", NodeCmd.class.getName());
        hf.printHelp(usage, "", options, "");
        System.out.println(header.toString());
    }
private static void printUsage ( ) { HelpFormatter hf = new HelpFormatter ( ) ; StringBuilder header = new StringBuilder ( ) ; header . append ( "\nAvailable commands:\n" ) ; addCmdHelp ( header , "ring" , "Print informations on the token ring" ) ; addCmdHelp ( header , "join" , "Join the ring" ) ; addCmdHelp ( header , "info" , "Print node informations (uptime, load, ...)" ) ; addCmdHelp ( header , "cfstats" , "Print statistics on column families" ) ; addCmdHelp ( header , "version" , "Print cassandra version" ) ; addCmdHelp ( header , "tpstats" , "Print usage statistics of thread pools" ) ; addCmdHelp ( header , "drain" , "Drain the node (stop accepting writes and flush all column families)" ) ; addCmdHelp ( header , "decommission" , "Decommission the node" ) ; addCmdHelp ( header , "compactionstats" , "Print statistics on compactions" ) ; addCmdHelp ( header , "disablegossip" , "Disable gossip (effectively marking the node dead)" ) ; addCmdHelp ( header , "enablegossip" , "Reenable gossip" ) ; addCmdHelp ( header , "disablethrift" , "Disable thrift server" ) ; addCmdHelp ( header , "enablethrift" , "Reenable thrift server" ) ; addCmdHelp ( header , "statusthrift" , "Status of thrift server" ) ; addCmdHelp ( header , "gossipinfo" , "Shows the gossip information for the cluster" ) ; addCmdHelp ( header , "invalidatekeycache" , "Invalidate the key cache" ) ; addCmdHelp ( header , "invalidaterowcache" , "Invalidate the row cache" ) ; addCmdHelp ( header , "netstats [host]" , "Print network information on provided host (connecting node by default)" ) ; addCmdHelp ( header , "move <new token>" , "Move node on the token ring to a new token" ) ; addCmdHelp ( header , "removetoken status|force|<token>" , "Show status of current token removal, force completion of pending removal or remove providen token" ) ; addCmdHelp ( header , "setcompactionthroughput <value_in_mb>" , "Set the MB/s throughput cap for compaction in the system, or 0 to disable throttling." ) ; addCmdHelp ( header , "setstreamthroughput <value_in_mb>" , "Set the MB/s throughput cap for streaming in the system, or 0 to disable throttling." ) ; addCmdHelp ( header , "describering [keyspace]" , "Shows the token ranges info of a given keyspace." ) ; addCmdHelp ( header , "snapshot [keyspaces...] -t [snapshotName]" , "Take a snapshot of the specified keyspaces using optional name snapshotName" ) ; addCmdHelp ( header , "clearsnapshot [keyspaces...] -t [snapshotName]" , "Remove snapshots for the specified keyspaces. Either remove all snapshots or remove the snapshots with the given name." ) ; addCmdHelp ( header , "flush [keyspace] [cfnames]" , "Flush one or more column family" ) ; addCmdHelp ( header , "repair [keyspace] [cfnames]" , "Repair one or more column family (use -rp to repair only the first range returned by the partitioner)" ) ; addCmdHelp ( header , "cleanup [keyspace] [cfnames]" , "Run cleanup on one or more column family" ) ; addCmdHelp ( header , "compact [keyspace] [cfnames]" , "Force a (major) compaction on one or more column family" ) ; addCmdHelp ( header , "scrub [keyspace] [cfnames]" , "Scrub (rebuild sstables for) one or more column family" ) ; addCmdHelp ( header , "upgradesstables [keyspace] [cfnames]" , "Scrub (rebuild sstables for) one or more column family" ) ; addCmdHelp ( header , "getcompactionthreshold <keyspace> <cfname>" , "Print min and max compaction thresholds for a given column family" ) ; addCmdHelp ( header , "cfhistograms <keyspace> <cfname>" , "Print statistic histograms for a given column family" ) ; addCmdHelp ( header , "refresh <keyspace> <cf-name>" , "Load newly placed SSTables to the system without restart." ) ; addCmdHelp ( header , "getendpoints <keyspace> <cf> <key>" , "Print the end points that owns the key" ) ; addCmdHelp ( header , "setcachecapacity <keyspace> <cfname> <keycachecapacity> <rowcachecapacity>" , "Set the key and row cache capacities of a given column family" ) ; addCmdHelp ( header , "setcompactionthreshold <keyspace> <cfname> <minthreshold> <maxthreshold>" , "Set the min and max compaction thresholds for a given column family" ) ; addCmdHelp ( header , "stop <compaction_type>" , "Supported types are COMPACTION, VALIDATION, CLEANUP, SCRUB, INDEX_BUILD" ) ; String usage = String . format ( "java %s --host <arg> <command>%n" , NodeCmd . class . getName ( ) ) ; hf . printHelp ( usage , "" , options , "" ) ; System . out . println ( header . toString ( ) ) ; }
Prints usage information to stdout.
Prints usage information to stdout .
// No args // One arg // Two args // Three args // Four args