@Test public void testUnresolvableHostname1() throws UnknownHostException, ConfigurationException { Configuration config = new Configuration(); config.setString(JobManagerOptions.ADDRESS, nonExistingHostname); config.setInteger(JobManagerOptions.PORT, 17234); StandaloneUtils.createLeaderRetrievalService( config, false, JobMaster.JOB_MANAGER_NAME); }
@Test public void testUnresolvableHostname2() throws Exception { try { Configuration config = new Configuration(); config.setString(JobManagerOptions.ADDRESS, nonExistingHostname); config.setInteger(JobManagerOptions.PORT, 17234); StandaloneUtils.createLeaderRetrievalService( config, true, JobMaster.JOB_MANAGER_NAME); fail("This should fail with an UnknownHostException"); } catch (UnknownHostException e) { // that is what we want! } }
/** * Creates a {@link StandaloneLeaderRetrievalService} from the given configuration. The * host and port for the remote Akka URL are retrieved from the provided configuration. * * @param configuration Configuration instance containing the host and port information * @return StandaloneLeaderRetrievalService * @throws ConfigurationException * @throws UnknownHostException */ public static StandaloneLeaderRetrievalService createLeaderRetrievalService(Configuration configuration) throws ConfigurationException, UnknownHostException { return createLeaderRetrievalService( configuration, false, null); }
/** * Creates a {@link StandaloneLeaderRetrievalService} from the given configuration. The * host and port for the remote Akka URL are retrieved from the provided configuration. * * @param configuration Configuration instance containing the host and port information * @return StandaloneLeaderRetrievalService * @throws ConfigurationException * @throws UnknownHostException */ public static StandaloneLeaderRetrievalService createLeaderRetrievalService(Configuration configuration) throws ConfigurationException, UnknownHostException { return createLeaderRetrievalService( configuration, false, null); }
/** * Creates a {@link StandaloneLeaderRetrievalService} from the given configuration. The * host and port for the remote Akka URL are retrieved from the provided configuration. * * @param configuration Configuration instance containing the host and port information * @return StandaloneLeaderRetrievalService * @throws ConfigurationException * @throws UnknownHostException */ public static StandaloneLeaderRetrievalService createLeaderRetrievalService(Configuration configuration) throws ConfigurationException, UnknownHostException { return createLeaderRetrievalService( configuration, false, null); }
/** * Creates a {@link StandaloneLeaderRetrievalService} from the given configuration. The * host and port for the remote Akka URL are retrieved from the provided configuration. * * @param configuration Configuration instance containing the host and port information * @return StandaloneLeaderRetrievalService * @throws ConfigurationException * @throws UnknownHostException */ public static StandaloneLeaderRetrievalService createLeaderRetrievalService(Configuration configuration) throws ConfigurationException, UnknownHostException { return createLeaderRetrievalService( configuration, false, null); }