flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-clients/src/main/java/org/apache/flink/client/CliFrontend.java
/**
	 * Executes the STOP action.
	 *
	 * @param args Command line arguments for the stop action.
	 */
Executes the STOP action.
@param args Command line arguments for the stop action.
Executes the STOP action . @param args Command line arguments for the stop action .
protected int stop(String[] args) {
		LOG.info("Running 'stop' command.");
		StopOptions options;
		try {
			options = CliFrontendParser.parseStopCommand(args);
		}
		catch (CliArgsException e) {
			return handleArgException(e);
		}
		catch (Throwable t) {
			return handleError(t);
		}
		if (options.isPrintHelp()) {
			CliFrontendParser.printHelpForStop();
			return 0;
		}
		String[] stopArgs = options.getArgs();
		JobID jobId;
		if (stopArgs.length > 0) {
			String jobIdString = stopArgs[0];
			try {
				jobId = new JobID(StringUtils.hexStringToByte(jobIdString));
			}
			catch (Exception e) {
				return handleError(e);
			}
		}
		else {
			return handleArgException(new CliArgsException("Missing JobID"));
		}
		try {
			CustomCommandLine<?> activeCommandLine = getActiveCustomCommandLine(options.getCommandLine());
			ClusterClient client = activeCommandLine.retrieveCluster(options.getCommandLine(), config, configurationDirectory);
			try {
				logAndSysout("Stopping job " + jobId + '.');
				client.stop(jobId);
				logAndSysout("Stopped job " + jobId + '.');
				return 0;
			} finally {
				client.shutdown();
			}
		}
		catch (Throwable t) {
			return handleError(t);
		}
	}
protected int stop ( String [ ] args ) { LOG . info ( "Running 'stop' command." ) ; StopOptions options ; try { options = CliFrontendParser . parseStopCommand ( args ) ; } catch ( CliArgsException e ) { return handleArgException ( e ) ; } catch ( Throwable t ) { return handleError ( t ) ; } if ( options . isPrintHelp ( ) ) { CliFrontendParser . printHelpForStop ( ) ; return 0 ; } String [ ] stopArgs = options . getArgs ( ) ; JobID jobId ; if ( stopArgs . length > 0 ) { String jobIdString = stopArgs [ 0 ] ; try { jobId = new JobID ( StringUtils . hexStringToByte ( jobIdString ) ) ; } catch ( Exception e ) { return handleError ( e ) ; } } else { return handleArgException ( new CliArgsException ( "Missing JobID" ) ) ; } try { CustomCommandLine < ? > activeCommandLine = getActiveCustomCommandLine ( options . getCommandLine ( ) ) ; ClusterClient client = activeCommandLine . retrieveCluster ( options . getCommandLine ( ) , config , configurationDirectory ) ; try { logAndSysout ( "Stopping job " + jobId + '.' ) ; client . stop ( jobId ) ; logAndSysout ( "Stopped job " + jobId + '.' ) ; return 0 ; } finally { client . shutdown ( ) ; } } catch ( Throwable t ) { return handleError ( t ) ; } }
Executes the STOP action.
Executes the STOP action .
// evaluate help flag