@Test public void assertAllExecutors() { when(registryCenter.getDirectly(HANode.FRAMEWORK_ID_NODE)).thenReturn("d8701508-41b7-471e-9b32-61cf824a660d-0000"); MesosStateService service = new MesosStateService(registryCenter); Collection<ExecutorStateInfo> executorStateInfo = service.executors(); assertThat(executorStateInfo.size(), is(1)); ExecutorStateInfo executor = executorStateInfo.iterator().next(); assertThat(executor.getId(), is("foo_app@-@d8701508-41b7-471e-9b32-61cf824a660d-S0")); assertThat(executor.getSlaveId(), is("d8701508-41b7-471e-9b32-61cf824a660d-S0")); }
public Collection<ExecutorStateInfo> executors(final String appName) throws JsonParseException { return findExecutors(fetch(stateUrl).get("frameworks").getAsJsonArray(), appName).stream().map(each -> { try { return ExecutorStateInfo.builder().id(getExecutorId(each)).slaveId(each.get("slave_id").getAsString()).build(); } catch (final JsonParseException ex) { throw new RuntimeException(ex); } }).collect(Collectors.toList()); }
MesosStateService { public Collection<ExecutorStateInfo> executors(final String appName) throws JsonParseException { return findExecutors(fetch(stateUrl).get("frameworks").getAsJsonArray(), appName).stream().map(each -> { try { return ExecutorStateInfo.builder().id(getExecutorId(each)).slaveId(each.get("slave_id").getAsString()).build(); } catch (final JsonParseException ex) { throw new RuntimeException(ex); } }).collect(Collectors.toList()); } }
MesosStateService { public Collection<ExecutorStateInfo> executors(final String appName) throws JsonParseException { return findExecutors(fetch(stateUrl).get("frameworks").getAsJsonArray(), appName).stream().map(each -> { try { return ExecutorStateInfo.builder().id(getExecutorId(each)).slaveId(each.get("slave_id").getAsString()).build(); } catch (final JsonParseException ex) { throw new RuntimeException(ex); } }).collect(Collectors.toList()); } MesosStateService(final CoordinatorRegistryCenter regCenter); }
MesosStateService { public Collection<ExecutorStateInfo> executors(final String appName) throws JsonParseException { return findExecutors(fetch(stateUrl).get("frameworks").getAsJsonArray(), appName).stream().map(each -> { try { return ExecutorStateInfo.builder().id(getExecutorId(each)).slaveId(each.get("slave_id").getAsString()).build(); } catch (final JsonParseException ex) { throw new RuntimeException(ex); } }).collect(Collectors.toList()); } MesosStateService(final CoordinatorRegistryCenter regCenter); static synchronized void register(final String hostName, final int port); static synchronized void deregister(); Collection<Map<String, String>> sandbox(final String appName); Collection<ExecutorStateInfo> executors(final String appName); Collection<ExecutorStateInfo> executors(); }
MesosStateService { public Collection<ExecutorStateInfo> executors(final String appName) throws JsonParseException { return findExecutors(fetch(stateUrl).get("frameworks").getAsJsonArray(), appName).stream().map(each -> { try { return ExecutorStateInfo.builder().id(getExecutorId(each)).slaveId(each.get("slave_id").getAsString()).build(); } catch (final JsonParseException ex) { throw new RuntimeException(ex); } }).collect(Collectors.toList()); } MesosStateService(final CoordinatorRegistryCenter regCenter); static synchronized void register(final String hostName, final int port); static synchronized void deregister(); Collection<Map<String, String>> sandbox(final String appName); Collection<ExecutorStateInfo> executors(final String appName); Collection<ExecutorStateInfo> executors();  }