@Override public StandaloneClusterDescriptor createClusterDescriptor( CommandLine commandLine) throws FlinkException { final Configuration effectiveConfiguration = applyCommandLineOptionsToConfiguration(commandLine); return new StandaloneClusterDescriptor(effectiveConfiguration); }
@Override public StandaloneClusterClient retrieveCluster(CommandLine commandLine, Configuration config) { if (commandLine.hasOption(CliFrontendParser.ADDRESS_OPTION.getOpt())) { String addressWithPort = commandLine.getOptionValue(CliFrontendParser.ADDRESS_OPTION.getOpt()); InetSocketAddress jobManagerAddress = ClientUtils.parseHostPortAddress(addressWithPort); setJobManagerAddressInConfig(config, jobManagerAddress); } if (commandLine.hasOption(CliFrontendParser.ZOOKEEPER_NAMESPACE_OPTION.getOpt())) { String zkNamespace = commandLine.getOptionValue(CliFrontendParser.ZOOKEEPER_NAMESPACE_OPTION.getOpt()); config.setString(HighAvailabilityOptions.HA_CLUSTER_ID, zkNamespace); } StandaloneClusterDescriptor descriptor = new StandaloneClusterDescriptor(config); return descriptor.retrieve(null); }
@Override public StandaloneClusterClient createCluster( String applicationName, CommandLine commandLine, Configuration config, List<URL> userJarFiles) throws UnsupportedOperationException { StandaloneClusterDescriptor descriptor = new StandaloneClusterDescriptor(config); return descriptor.deploy(); } }
/** * Tests that command line options override the configuration settings. */ @Test public void testRESTManualConfigurationOverride() throws Exception { final String configuredHostname = "localhost"; final int configuredPort = 1234; final Configuration configuration = new Configuration(); configuration.setString(JobManagerOptions.ADDRESS, configuredHostname); configuration.setInteger(JobManagerOptions.PORT, configuredPort); configuration.setString(RestOptions.ADDRESS, configuredHostname); configuration.setInteger(RestOptions.PORT, configuredPort); final DefaultCLI defaultCLI = new DefaultCLI(configuration); final String manualHostname = "123.123.123.123"; final int manualPort = 4321; final String[] args = {"-m", manualHostname + ':' + manualPort}; CommandLine commandLine = defaultCLI.parseCommandLineOptions(args, false); final StandaloneClusterDescriptor clusterDescriptor = defaultCLI.createClusterDescriptor(commandLine); final RestClusterClient<?> clusterClient = clusterDescriptor.retrieve(defaultCLI.getClusterId(commandLine)); URL webMonitorBaseUrl = clusterClient.getWebMonitorBaseUrl().get(); assertThat(webMonitorBaseUrl.getHost(), equalTo(manualHostname)); assertThat(webMonitorBaseUrl.getPort(), equalTo(manualPort)); }
public static ClusterClient createStandaloneClient(LauncherOptions launcherOptions) throws Exception { String flinkConfDir = launcherOptions.getFlinkconf(); Configuration config = GlobalConfiguration.loadConfiguration(flinkConfDir); StandaloneClusterDescriptor standaloneClusterDescriptor = new StandaloneClusterDescriptor(config); RestClusterClient clusterClient = standaloneClusterDescriptor.retrieve(StandaloneClusterId.getInstance()); LeaderConnectionInfo connectionInfo = clusterClient.getClusterConnectionInfo(); InetSocketAddress address = AkkaUtils.getInetSocketAddressFromAkkaURL(connectionInfo.getAddress()); config.setString(JobManagerOptions.ADDRESS, address.getAddress().getHostName()); config.setInteger(JobManagerOptions.PORT, address.getPort()); clusterClient.setDetached(true); return clusterClient; }
public static ClusterClient createStandaloneClient(LauncherOptions launcherOptions) throws Exception { String flinkConfDir = launcherOptions.getFlinkconf(); Configuration config = GlobalConfiguration.loadConfiguration(flinkConfDir); StandaloneClusterDescriptor standaloneClusterDescriptor = new StandaloneClusterDescriptor(config); RestClusterClient clusterClient = standaloneClusterDescriptor.retrieve(StandaloneClusterId.getInstance()); LeaderConnectionInfo connectionInfo = clusterClient.getClusterConnectionInfo(); InetSocketAddress address = AkkaUtils.getInetSocketAddressFromAkkaURL(connectionInfo.getAddress()); config.setString(JobManagerOptions.ADDRESS, address.getAddress().getHostName()); config.setInteger(JobManagerOptions.PORT, address.getPort()); clusterClient.setDetached(true); return clusterClient; }
@Override public StandaloneClusterDescriptor createClusterDescriptor( CommandLine commandLine) throws FlinkException { final Configuration effectiveConfiguration = applyCommandLineOptionsToConfiguration(commandLine); return new StandaloneClusterDescriptor(effectiveConfiguration); }
@Override public StandaloneClusterDescriptor createClusterDescriptor( CommandLine commandLine) throws FlinkException { final Configuration effectiveConfiguration = applyCommandLineOptionsToConfiguration(commandLine); return new StandaloneClusterDescriptor(effectiveConfiguration); }