public static void main(String[] args) throws Exception {
        LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
        context.getLoggerList().get(0).setLevel(Level.ERROR);

        System.out.println("Pravega Admin Tools.\n");
        @Cleanup
        AdminCommandState state = new AdminCommandState();

        // Output loaded config.
        System.out.println("Initial configuration:");
        val initialConfigCmd = new ConfigListCommand(new CommandArgs(Collections.emptyList(), state));
        initialConfigCmd.execute();

        // Continuously accept new commands as long as the user entered one.
        System.out.println(String.format("%nType \"%s\" for list of commands, or \"%s\" to exit.", CMD_HELP, CMD_EXIT));
        @Cleanup
        Scanner input = new Scanner(System.in);
        while (true) {
            System.out.print(System.lineSeparator() + "> ");
            String line = input.nextLine();
            if (Strings.isNullOrEmpty(line.trim())) {
                continue;
            }

            Parser.Command pc = Parser.parse(line);
            switch (pc.getComponent()) {
                case CMD_HELP:
                    printHelp(null);
                    break;
                case CMD_EXIT:
                    System.exit(0);
                    break;
                default:
                    execCommand(pc, state);
                    break;
            }
        }
    }
public static void main ( String [ ] args ) throws Exception { LoggerContext context = ( LoggerContext ) LoggerFactory . getILoggerFactory ( ) ; context . getLoggerList ( ) . get ( 0 ) . setLevel ( Level . ERROR ) ; System . out . println ( "Pravega Admin Tools.\n" ) ; @ Cleanup AdminCommandState state = new AdminCommandState ( ) ; System . out . println ( "Initial configuration:" ) ; val initialConfigCmd = new ConfigListCommand ( new CommandArgs ( Collections . emptyList ( ) , state ) ) ; initialConfigCmd . execute ( ) ; System . out . println ( String . format ( "%nType \"%s\" for list of commands, or \"%s\" to exit." , CMD_HELP , CMD_EXIT ) ) ; @ Cleanup Scanner input = new Scanner ( System . in ) ; while ( true ) { System . out . print ( System . lineSeparator ( ) + "> " ) ; String line = input . nextLine ( ) ; if ( Strings . isNullOrEmpty ( line . trim ( ) ) ) { continue ; } Parser . Command pc = Parser . parse ( line ) ; switch ( pc . getComponent ( ) ) { case CMD_HELP : printHelp ( null ) ; break ; case CMD_EXIT : System . exit ( 0 ) ; break ; default : execCommand ( pc , state ) ; break ; } } }
Main entry point for the Admin Tools Runner.
<p>
To speed up setup, create a config.properties file and put the following properties (at a minimum):
<p>
pravegaservice.containerCount={number of containers}
pravegaservice.zkURL={host:port for ZooKeeper}
bookkeeper.bkLedgerPath={path in ZooKeeper where BookKeeper stores Ledger metadata}
bookkeeper.zkMetadataPath={path in ZooKeeper where Pravega stores BookKeeperLog metadata}
<p>
Then invoke this program with:
-Dpravega.configurationFile=config.properties

@param args Arguments.
@throws Exception If one occurred.