/** * Creates a new client with the host and port specified. */ public AdminClient(String host, int port) { this.closer = Closer.create(); URI serverUri = URI.create(String.format("http://%s:%d/", host, port)); this.client = new JobExecutionInfoClient(serverUri.toString()); this.closer.register(this.client); }
@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); }
/** * Creates a new client with the host and port specified. */ public AdminClient(String host, int port) { this.closer = Closer.create(); URI serverUri = URI.create(String.format("http://%s:%d/", host, port)); this.client = new JobExecutionInfoClient(serverUri.toString()); this.closer.register(this.client); }