private void addJobExecutionServerAndAdminUI(Properties properties) { boolean jobExecInfoServerEnabled = Boolean .valueOf(properties.getProperty(ConfigurationKeys.JOB_EXECINFO_SERVER_ENABLED_KEY, Boolean.FALSE.toString())); boolean adminUiServerEnabled = Boolean.valueOf(properties.getProperty(ConfigurationKeys.ADMIN_SERVER_ENABLED_KEY, Boolean.FALSE.toString())); if (jobExecInfoServerEnabled) { LOG.info("Will launch the job execution info server"); JobExecutionInfoServer executionInfoServer = new JobExecutionInfoServer(properties); addService(executionInfoServer); if (adminUiServerEnabled) { LOG.info("Will launch the admin UI server"); addService(createAdminServer(properties, executionInfoServer.getAdvertisedServerUri())); } } else if (adminUiServerEnabled) { LOG.warn("Not launching the admin UI because the job execution info server is not enabled"); } }
public JobExecutionInfoServer(Properties properties) { this.properties = properties; port = getPort(properties); serverUri = getServiceUri(getHost(properties), port); serverAdvertisedUri = getAdvertisedUri(properties); }
private static URI getAdvertisedUri(Properties properties) { return URI.create(properties.getProperty( ConfigurationKeys.REST_SERVER_ADVERTISED_URI_KEY, getServiceUri(getHost(properties), getPort(properties)).toString())); } }
@BeforeClass public void setUp() throws Exception { testMetastoreDatabase = TestMetastoreDatabaseFactory.get(); Properties properties = new Properties(); properties.setProperty(ConfigurationKeys.JOB_HISTORY_STORE_URL_KEY, testMetastoreDatabase.getJdbcUrl()); int randomPort = chooseRandomPort(); properties.setProperty(ConfigurationKeys.REST_SERVER_PORT_KEY, Integer.toString(randomPort)); Injector injector = Guice.createInjector(new MetaStoreModule(properties)); this.jobHistoryStore = injector.getInstance(JobHistoryStore.class); this.client = new JobExecutionInfoClient(String.format("http://%s:%s/", "localhost", randomPort)); this.server = new JobExecutionInfoServer(properties); this.server.startUp(); this.expected1 = createJobExecutionInfo(1); this.expected2 = createJobExecutionInfo(2); this.jobHistoryStore.put(this.expected1); this.jobHistoryStore.put(this.expected2); }
private static URI getAdvertisedUri(Properties properties) { return URI.create(properties.getProperty( ConfigurationKeys.REST_SERVER_ADVERTISED_URI_KEY, getServiceUri(getHost(properties), getPort(properties)).toString())); } }
LOGGER.info("Starting the job execution info server since it is enabled"); Properties properties = ConfigUtils.configToProperties(config); JobExecutionInfoServer executionInfoServer = new JobExecutionInfoServer(properties); services.add(executionInfoServer); if (config.getBoolean(ConfigurationKeys.ADMIN_SERVER_ENABLED_KEY)) { LOGGER.info("Starting the admin UI server since it is enabled"); services.add(ServiceBasedAppLauncher.createAdminServer(properties, executionInfoServer.getAdvertisedServerUri()));
public JobExecutionInfoServer(Properties properties) { this.properties = properties; port = getPort(properties); serverUri = getServiceUri(getHost(properties), port); serverAdvertisedUri = getAdvertisedUri(properties); }
private void addJobExecutionServerAndAdminUI(Properties properties) { boolean jobExecInfoServerEnabled = Boolean .valueOf(properties.getProperty(ConfigurationKeys.JOB_EXECINFO_SERVER_ENABLED_KEY, Boolean.FALSE.toString())); boolean adminUiServerEnabled = Boolean.valueOf(properties.getProperty(ConfigurationKeys.ADMIN_SERVER_ENABLED_KEY, Boolean.FALSE.toString())); if (jobExecInfoServerEnabled) { LOG.info("Will launch the job execution info server"); JobExecutionInfoServer executionInfoServer = new JobExecutionInfoServer(properties); addService(executionInfoServer); if (adminUiServerEnabled) { LOG.info("Will launch the admin UI server"); addService(createAdminServer(properties, executionInfoServer.getAdvertisedServerUri())); } } else if (adminUiServerEnabled) { LOG.warn("Not launching the admin UI because the job execution info server is not enabled"); } }
LOGGER.info("Starting the job execution info server since it is enabled"); Properties properties = ConfigUtils.configToProperties(config); JobExecutionInfoServer executionInfoServer = new JobExecutionInfoServer(properties); services.add(executionInfoServer); if (config.getBoolean(ConfigurationKeys.ADMIN_SERVER_ENABLED_KEY)) { LOGGER.info("Starting the admin UI server since it is enabled"); services.add(ServiceBasedAppLauncher.createAdminServer(properties, executionInfoServer.getAdvertisedServerUri()));