public static void executeCommand ( String [ ] args ) throws IOException { OptionParser parser = getParser ( ) ; String url = null ; Boolean confirm = false ; // parse command-line input OptionSet options = parser . parse ( args ) ; if ( options . has ( AdminParserUtils . OPT_HELP ) ) { printHelp ( System . out ) ; return ; } AdminParserUtils . checkRequired ( options , AdminParserUtils . OPT_URL ) ; url = ( String ) options . valueOf ( AdminParserUtils . OPT_URL ) ; if ( options . has ( AdminParserUtils . OPT_CONFIRM ) ) { confirm = true ; } // print summary System . out . println ( "Synchronize metadata versions across all nodes" ) ; System . out . println ( "Location:" ) ; System . out . println ( " bootstrap url = " + url ) ; System . out . println ( " node = all nodes" ) ; AdminClient adminClient = AdminToolUtils . getAdminClient ( url ) ; AdminToolUtils . assertServerNotInRebalancingState ( adminClient ) ; Versioned < Properties > versionedProps = mergeAllVersions ( adminClient ) ; printVersions ( versionedProps ) ; // execute command if ( ! AdminToolUtils . askConfirm ( confirm , "do you want to synchronize metadata versions to all node" ) ) return ; adminClient . metadataMgmtOps . setMetadataVersion ( versionedProps ) ; }
Parses command - line and synchronizes metadata versions across all nodes .