actorSystem = BootstrapTools.startActorSystem( configuration, ownHostname.getCanonicalHostName(),
ConfigConstants.DEFAULT_YARN_CONTAINER_START_COMMAND_TEMPLATE); final String amCommand = BootstrapTools.getStartCommand(commandTemplate, startCommandValues);
taskManagerParameters.taskManagerDirectMemoryLimitMB()); Configuration taskManagerConfig = BootstrapTools.cloneConfiguration(flinkConfig);
BootstrapTools.substituteDeprecatedConfigPrefix(configuration, ConfigConstants.YARN_APPLICATION_MASTER_ENV_PREFIX, ResourceManagerOptions.CONTAINERIZED_MASTER_ENV_PREFIX); BootstrapTools.substituteDeprecatedConfigPrefix(configuration, ConfigConstants.YARN_TASK_MANAGER_ENV_PREFIX, ResourceManagerOptions.CONTAINERIZED_TASK_MANAGER_ENV_PREFIX); BootstrapTools.updateTmpDirectoriesInConfiguration(configuration, localDirs);
new File(workingDirectory, UUID.randomUUID() + "-taskmanager-conf.yaml"); log.debug("Writing TaskManager configuration to {}", taskManagerConfigFile.getAbsolutePath()); BootstrapTools.writeConfiguration(taskManagerConfig, taskManagerConfigFile); boolean hasLog4j = new File(workingDirectory, "log4j.properties").exists(); String launchCommand = BootstrapTools.getTaskManagerShellCommand( flinkConfig, tmParams, ".", ApplicationConstants.LOG_DIR_EXPANSION_VAR, hasLogback, hasLog4j, hasKrb5, taskManagerMainClass);
YarnConfigOptions.APPLICATION_MASTER_PORT); actorSystem = BootstrapTools.startActorSystem(config, appMasterHostname, amPortRange, LOG); final Configuration taskManagerConfig = BootstrapTools.generateTaskManagerConfiguration( config, akkaHostname, akkaPort, slotsPerTaskManager, TASKMANAGER_REGISTRATION_TIMEOUT); LOG.debug("TaskManager configuration: {}", taskManagerConfig); webMonitor = BootstrapTools.startWebMonitorIfConfigured( config, highAvailabilityServices,
/** * Loads the global configuration, adds the given dynamic properties configuration, and sets * the temp directory paths. * * @param dynamicProperties dynamic properties to integrate * @param log logger instance * @return the loaded and adapted global configuration */ public static Configuration loadConfiguration(Configuration dynamicProperties, Logger log) { Configuration configuration = GlobalConfiguration.loadConfigurationWithDynamicProperties(dynamicProperties); // read the environment variables final Map<String, String> envs = System.getenv(); final String tmpDirs = envs.get(MesosConfigKeys.ENV_FLINK_TMP_DIR); BootstrapTools.updateTmpDirectoriesInConfiguration(configuration, tmpDirs); return configuration; } }
BootstrapTools.writeConfiguration(configuration, tmpConfigurationFile);
YarnConfigOptions.APPLICATION_MASTER_PORT); actorSystem = BootstrapTools.startActorSystem(config, appMasterHostname, amPortRange, LOG); final Configuration taskManagerConfig = BootstrapTools.generateTaskManagerConfiguration( config, akkaHostname, akkaPort, slotsPerTaskManager, TASKMANAGER_REGISTRATION_TIMEOUT); LOG.debug("TaskManager configuration: {}", taskManagerConfig); webMonitor = BootstrapTools.startWebMonitorIfConfigured( config, highAvailabilityServices,
BootstrapTools.substituteDeprecatedConfigPrefix(configuration, ConfigConstants.YARN_APPLICATION_MASTER_ENV_PREFIX, ResourceManagerOptions.CONTAINERIZED_MASTER_ENV_PREFIX); BootstrapTools.substituteDeprecatedConfigPrefix(configuration, ConfigConstants.YARN_TASK_MANAGER_ENV_PREFIX, ResourceManagerOptions.CONTAINERIZED_TASK_MANAGER_ENV_PREFIX); BootstrapTools.updateTmpDirectoriesInConfiguration(configuration, localDirs);
new File(workingDirectory, UUID.randomUUID() + "-taskmanager-conf.yaml"); log.debug("Writing TaskManager configuration to {}", taskManagerConfigFile.getAbsolutePath()); BootstrapTools.writeConfiguration(taskManagerConfig, taskManagerConfigFile); boolean hasLog4j = new File(workingDirectory, "log4j.properties").exists(); String launchCommand = BootstrapTools.getTaskManagerShellCommand( flinkConfig, tmParams, ".", ApplicationConstants.LOG_DIR_EXPANSION_VAR, hasLogback, hasLog4j, hasKrb5, taskManagerMainClass);
LOG.info("TM: remoteKeytabPrincipal obtained {}", remoteKeytabPrincipal); BootstrapTools.updateTmpDirectoriesInConfiguration(configuration, localDirs);
BootstrapTools.writeConfiguration( globalConfiguration, new File(tempConfPathForSecureRun, "flink-conf.yaml"));
/** * Starts an Actor System at a specific port without enlarge the ThreadPool. * @param configuration The Flink configuration. * @param listeningAddress The address to listen at. * @param listeningPort The port to listen at. * @param logger the logger to output log information. * @return The ActorSystem which has been started. * @throws Exception */ public static ActorSystem startActorSystem( Configuration configuration, String listeningAddress, int listeningPort, Logger logger) throws Exception { return startActorSystem(configuration, listeningAddress, listeningPort, logger, false); }
YarnConfigOptions.APPLICATION_MASTER_PORT); actorSystem = BootstrapTools.startActorSystem(config, appMasterHostname, amPortRange, LOG); final Configuration taskManagerConfig = BootstrapTools.generateTaskManagerConfiguration( config, akkaHostname, akkaPort, slotsPerTaskManager, TASKMANAGER_REGISTRATION_TIMEOUT); LOG.debug("TaskManager configuration: {}", taskManagerConfig); webMonitor = BootstrapTools.startWebMonitorIfConfigured( config, highAvailabilityServices,
ConfigConstants.DEFAULT_YARN_CONTAINER_START_COMMAND_TEMPLATE); final String amCommand = BootstrapTools.getStartCommand(commandTemplate, startCommandValues);
BootstrapTools.substituteDeprecatedConfigPrefix(configuration, ConfigConstants.YARN_APPLICATION_MASTER_ENV_PREFIX, ResourceManagerOptions.CONTAINERIZED_MASTER_ENV_PREFIX); BootstrapTools.substituteDeprecatedConfigPrefix(configuration, ConfigConstants.YARN_TASK_MANAGER_ENV_PREFIX, ResourceManagerOptions.CONTAINERIZED_TASK_MANAGER_ENV_PREFIX); BootstrapTools.updateTmpDirectoriesInConfiguration(configuration, localDirs);
taskManagerParameters.taskManagerDirectMemoryLimitMB()); Configuration taskManagerConfig = BootstrapTools.cloneConfiguration(flinkConfig);
new File(workingDirectory, UUID.randomUUID() + "-taskmanager-conf.yaml"); log.debug("Writing TaskManager configuration to {}", taskManagerConfigFile.getAbsolutePath()); BootstrapTools.writeConfiguration(taskManagerConfig, taskManagerConfigFile); boolean hasLog4j = new File(workingDirectory, "log4j.properties").exists(); String launchCommand = BootstrapTools.getTaskManagerShellCommand( flinkConfig, tmParams, ".", ApplicationConstants.LOG_DIR_EXPANSION_VAR, hasLogback, hasLog4j, hasKrb5, taskManagerMainClass);
FileSystem.initialize(configuration); BootstrapTools.updateTmpDirectoriesInConfiguration(configuration, localDirs);