@Test public void canGetNoPortKeys() { Configuration config = new Configuration(); Set<String> portKeys = LaunchableMesosWorker.extractPortKeys(config); assertThat(portKeys, is(equalTo(LaunchableMesosWorker.TM_PORT_KEYS))); }
static Set<String> extractPortKeys(Configuration config) { final LinkedHashSet<String> tmPortKeys = new LinkedHashSet<>(TM_PORT_KEYS); final String portKeys = config.getString(PORT_ASSIGNMENTS); if (portKeys != null) { Arrays.stream(portKeys.split(",")) .map(String::trim) .peek(key -> LOG.debug("Adding port key {} to mesos request")) .forEach(tmPortKeys::add); } return Collections.unmodifiableSet(tmPortKeys); }
LaunchableMesosWorker implements LaunchableTask { static Set<String> extractPortKeys(Configuration config) { final LinkedHashSet<String> tmPortKeys = new LinkedHashSet<>(TM_PORT_KEYS); final String portKeys = config.getString(PORT_ASSIGNMENTS); if (portKeys != null) { Arrays.stream(portKeys.split(",")) .map(String::trim) .peek(key -> LOG.debug("Adding port key {} to mesos request")) .forEach(tmPortKeys::add); } return Collections.unmodifiableSet(tmPortKeys); } }
LaunchableMesosWorker implements LaunchableTask { static Set<String> extractPortKeys(Configuration config) { final LinkedHashSet<String> tmPortKeys = new LinkedHashSet<>(TM_PORT_KEYS); final String portKeys = config.getString(PORT_ASSIGNMENTS); if (portKeys != null) { Arrays.stream(portKeys.split(",")) .map(String::trim) .peek(key -> LOG.debug("Adding port key {} to mesos request")) .forEach(tmPortKeys::add); } return Collections.unmodifiableSet(tmPortKeys); } LaunchableMesosWorker(
			MesosArtifactResolver resolver,
			MesosTaskManagerParameters params,
			ContainerSpecification containerSpec,
			Protos.TaskID taskID,
			MesosConfiguration mesosConfiguration); }
LaunchableMesosWorker implements LaunchableTask { static Set<String> extractPortKeys(Configuration config) { final LinkedHashSet<String> tmPortKeys = new LinkedHashSet<>(TM_PORT_KEYS); final String portKeys = config.getString(PORT_ASSIGNMENTS); if (portKeys != null) { Arrays.stream(portKeys.split(",")) .map(String::trim) .peek(key -> LOG.debug("Adding port key {} to mesos request")) .forEach(tmPortKeys::add); } return Collections.unmodifiableSet(tmPortKeys); } LaunchableMesosWorker(
			MesosArtifactResolver resolver,
			MesosTaskManagerParameters params,
			ContainerSpecification containerSpec,
			Protos.TaskID taskID,
			MesosConfiguration mesosConfiguration); Protos.TaskID taskID(); @Override TaskRequest taskRequest(); @Override Protos.TaskInfo launch(Protos.SlaveID slaveId, MesosResourceAllocation allocation); @Override String toString(); }
LaunchableMesosWorker implements LaunchableTask { static Set<String> extractPortKeys(Configuration config) { final LinkedHashSet<String> tmPortKeys = new LinkedHashSet<>(TM_PORT_KEYS); final String portKeys = config.getString(PORT_ASSIGNMENTS); if (portKeys != null) { Arrays.stream(portKeys.split(",")) .map(String::trim) .peek(key -> LOG.debug("Adding port key {} to mesos request")) .forEach(tmPortKeys::add); } return Collections.unmodifiableSet(tmPortKeys); } LaunchableMesosWorker(
			MesosArtifactResolver resolver,
			MesosTaskManagerParameters params,
			ContainerSpecification containerSpec,
			Protos.TaskID taskID,
			MesosConfiguration mesosConfiguration); Protos.TaskID taskID(); @Override TaskRequest taskRequest(); @Override Protos.TaskInfo launch(Protos.SlaveID slaveId, MesosResourceAllocation allocation); @Override String toString();  }