/** * Gets the priority of every SystemStream for which the priority * was explicitly configured with a value >=0. * * @return the explicitly-configured stream priorities as a map from * SystemStream to the configured priority value. Streams that * were not explicitly configured with a priority are not returned. */ public Map<SystemStream, Integer> getPriorityStreams() { Set<SystemStream> allInputs = taskConfigJava.getAllInputStreams(); Map<SystemStream, Integer> priorityStreams = new HashMap<>(); for (SystemStream systemStream : allInputs) { int priority = streamConfig.getPriority(systemStream); if (priority >= 0) { priorityStreams.put(systemStream, priority); } } return Collections.unmodifiableMap(priorityStreams); } }
/** * Gets the priority of every SystemStream for which the priority * was explicitly configured with a value >=0. * * @return the explicitly-configured stream priorities as a map from * SystemStream to the configured priority value. Streams that * were not explicitly configured with a priority are not returned. */ public Map<SystemStream, Integer> getPriorityStreams() { Set<SystemStream> allInputs = taskConfigJava.getAllInputStreams(); Map<SystemStream, Integer> priorityStreams = new HashMap<>(); for (SystemStream systemStream : allInputs) { int priority = streamConfig.getPriority(systemStream); if (priority >= 0) { priorityStreams.put(systemStream, priority); } } return Collections.unmodifiableMap(priorityStreams); } }
/** * Gets the priority of every SystemStream for which the priority * was explicitly configured with a value >=0. * * @return the explicitly-configured stream priorities as a map from * SystemStream to the configured priority value. Streams that * were not explicitly configured with a priority are not returned. */ public Map<SystemStream, Integer> getPriorityStreams() { Set<SystemStream> allInputs = taskConfigJava.getAllInputStreams(); Map<SystemStream, Integer> priorityStreams = new HashMap<>(); for (SystemStream systemStream : allInputs) { int priority = streamConfig.getPriority(systemStream); if (priority >= 0) { priorityStreams.put(systemStream, priority); } } return Collections.unmodifiableMap(priorityStreams); } }
/** * Gets the priority of every SystemStream for which the priority * was explicitly configured with a value >=0. * * @return the explicitly-configured stream priorities as a map from * SystemStream to the configured priority value. Streams that * were not explicitly configured with a priority are not returned. */ public Map<SystemStream, Integer> getPriorityStreams() { Set<SystemStream> allInputs = taskConfigJava.getAllInputStreams(); Map<SystemStream, Integer> priorityStreams = new HashMap<>(); for (SystemStream systemStream : allInputs) { int priority = streamConfig.getPriority(systemStream); if (priority >= 0) { priorityStreams.put(systemStream, priority); } } return Collections.unmodifiableMap(priorityStreams); } }
/** * Gets the priority of every SystemStream for which the priority * was explicitly configured with a value >=0. * * @return the explicitly-configured stream priorities as a map from * SystemStream to the configured priority value. Streams that * were not explicitly configured with a priority are not returned. */ public Map<SystemStream, Integer> getPriorityStreams() { Set<SystemStream> allInputs = taskConfigJava.getAllInputStreams(); Map<SystemStream, Integer> priorityStreams = new HashMap<>(); for (SystemStream systemStream : allInputs) { int priority = streamConfig.getPriority(systemStream); if (priority >= 0) { priorityStreams.put(systemStream, priority); } } return Collections.unmodifiableMap(priorityStreams); } }
@Test public void testGenerateConfig() { // an example unbounded IO stream StreamSpec spec = new StreamSpec("stream-1", "physical-stream-1", "system-1", Collections.singletonMap("property1", "haha")); StreamEdge edge = new StreamEdge(spec, false, false, new MapConfig()); Config config = edge.generateConfig(); StreamConfig streamConfig = new StreamConfig(config); assertEquals(streamConfig.getSystem(spec.getId()), "system-1"); assertEquals(streamConfig.getPhysicalName(spec.getId()), "physical-stream-1"); assertEquals(streamConfig.getIsIntermediateStream(spec.getId()), false); assertEquals(streamConfig.getStreamProperties(spec.getId()).get("property1"), "haha"); // bounded stream spec = new StreamSpec("stream-1", "physical-stream-1", "system-1", Collections.singletonMap("property1", "haha")); edge = new StreamEdge(spec, false, false, new MapConfig()); config = edge.generateConfig(); streamConfig = new StreamConfig(config); // intermediate stream edge = new StreamEdge(spec, true, false, new MapConfig()); config = edge.generateConfig(); streamConfig = new StreamConfig(config); assertEquals(streamConfig.getIsIntermediateStream(spec.getId()), true); assertEquals(streamConfig.getDefaultStreamOffset(spec.toSystemStream()).get(), "oldest"); assertEquals(streamConfig.getPriority(spec.toSystemStream()), Integer.MAX_VALUE); } }