flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-mesos/src/main/java/org/apache/flink/mesos/runtime/clusterframework/MesosApplicationMasterRunner.java
/**
	 * The instance entry point for the Mesos AppMaster. Obtains user group
	 * information and calls the main work method {@link #runPrivileged(Configuration, Configuration)} as a
	 * privileged action.
	 *
	 * @param args The command line arguments.
	 * @return The process exit code.
	 */
The instance entry point for the Mesos AppMaster. Obtains user group
information and calls the main work method  #runPrivileged(Configuration, Configuration) as a
privileged action.

@param args The command line arguments.
@return The process exit code.
The instance entry point for the Mesos AppMaster . Obtains user group information and calls the main work method #runPrivileged ( Configuration Configuration ) as a privileged action . @param args The command line arguments . @return The process exit code .
protected int run(final String[] args) {
		try {
			LOG.debug("All environment variables: {}", ENV);
			CommandLineParser parser = new PosixParser();
			CommandLine cmd = parser.parse(ALL_OPTIONS, args);
			final Configuration dynamicProperties = BootstrapTools.parseDynamicProperties(cmd);
			final Configuration config = GlobalConfiguration.loadConfigurationWithDynamicProperties(dynamicProperties);
			try {
				FileSystem.initialize(config);
			} catch (IOException e) {
				throw new IOException("Error while configuring the filesystems.", e);
			}
			SecurityConfiguration sc = new SecurityConfiguration(config);
			SecurityUtils.install(sc);
			return SecurityUtils.getInstalledContext().runSecured(new Callable<Integer>() {
				@Override
				public Integer call() throws Exception {
					return runPrivileged(config, dynamicProperties);
				}
			});
		}
		catch (Throwable t) {
			LOG.error("Mesos AppMaster initialization failed", t);
			return INIT_ERROR_EXIT_CODE;
		}
	}
protected int run ( final String [ ] args ) { try { LOG . debug ( "All environment variables: {}" , ENV ) ; CommandLineParser parser = new PosixParser ( ) ; CommandLine cmd = parser . parse ( ALL_OPTIONS , args ) ; final Configuration dynamicProperties = BootstrapTools . parseDynamicProperties ( cmd ) ; final Configuration config = GlobalConfiguration . loadConfigurationWithDynamicProperties ( dynamicProperties ) ; try { FileSystem . initialize ( config ) ; } catch ( IOException e ) { throw new IOException ( "Error while configuring the filesystems." , e ) ; } SecurityConfiguration sc = new SecurityConfiguration ( config ) ; SecurityUtils . install ( sc ) ; return SecurityUtils . getInstalledContext ( ) . runSecured ( new Callable < Integer > ( ) { @ Override public Integer call ( ) throws Exception { return runPrivileged ( config , dynamicProperties ) ; } } ) ; } catch ( Throwable t ) { LOG . error ( "Mesos AppMaster initialization failed" , t ) ; return INIT_ERROR_EXIT_CODE ; } }
The instance entry point for the Mesos AppMaster.
The instance entry point for the Mesos AppMaster .
// loading all config values here has the advantage that the program fails fast, if any // configuration problem occurs // configure the filesystems // configure security // run the actual work in the installed security context // make sure that everything whatever ends up in the log