@Override public Map<String, String> toConfig() { HashMap<String, String> ehConfigs = new HashMap<>(super.toConfig()); String streamId = getStreamId(); ehConfigs.put(String.format(EventHubConfig.CONFIG_STREAM_NAMESPACE, streamId), namespace); ehConfigs.put(String.format(EventHubConfig.CONFIG_STREAM_ENTITYPATH, streamId), entityPath); sasKeyName.ifPresent(keyName -> ehConfigs.put(String.format(EventHubConfig.CONFIG_STREAM_SAS_KEY_NAME, streamId), keyName)); sasToken.ifPresent(key -> ehConfigs.put(String.format(EventHubConfig.CONFIG_STREAM_SAS_TOKEN, streamId), key)); return ehConfigs; }
final void addOutputDescriptor(OutputDescriptor outputDescriptor) { String streamId = outputDescriptor.getStreamId(); Preconditions.checkState(!outputDescriptors.containsKey(streamId) || outputDescriptors.get(streamId) == outputDescriptor, String.format("Cannot add an output descriptor multiple times with the same streamId: %s", streamId)); outputDescriptors.put(streamId, outputDescriptor); addSystemDescriptor(outputDescriptor.getSystemDescriptor()); }
@Override public TaskApplicationDescriptor withOutputStream(OutputDescriptor outputDescriptor) { addOutputDescriptor(outputDescriptor); getOrCreateStreamSerdes(outputDescriptor.getStreamId(), outputDescriptor.getSerde()); return this; }
@Before public void setUp() { when(defaultSystemDescriptor.getSystemName()).thenReturn(defaultSystemName); mockInputs.forEach(isd -> when(isd.getSystemDescriptor()).thenReturn(defaultSystemDescriptor)); mockOutputs.forEach(osd -> when(osd.getSystemDescriptor()).thenReturn(defaultSystemDescriptor)); }
@Override public GenericOutputDescriptor<StreamMessageType> withPhysicalName(String physicalName) { return super.withPhysicalName(physicalName); } }
@Override public GenericOutputDescriptor<StreamMessageType> withPhysicalName(String physicalName) { return super.withPhysicalName(physicalName); } }
@Override public TaskApplicationDescriptor withOutputStream(OutputDescriptor outputDescriptor) { addOutputDescriptor(outputDescriptor); getOrCreateStreamSerdes(outputDescriptor.getStreamId(), outputDescriptor.getSerde()); return this; }
final void addOutputDescriptor(OutputDescriptor outputDescriptor) { String streamId = outputDescriptor.getStreamId(); Preconditions.checkState(!outputDescriptors.containsKey(streamId) || outputDescriptors.get(streamId) == outputDescriptor, String.format("Cannot add an output descriptor multiple times with the same streamId: %s", streamId)); outputDescriptors.put(streamId, outputDescriptor); addSystemDescriptor(outputDescriptor.getSystemDescriptor()); }
private Map<String, String> generateSystemStreamConfigs(ApplicationDescriptorImpl<? extends ApplicationDescriptor> appDesc) { Map<String, String> systemStreamConfigs = new HashMap<>(); appDesc.getInputDescriptors().forEach((key, value) -> systemStreamConfigs.putAll(value.toConfig())); appDesc.getOutputDescriptors().forEach((key, value) -> systemStreamConfigs.putAll(value.toConfig())); appDesc.getSystemDescriptors().forEach(sd -> systemStreamConfigs.putAll(sd.toConfig())); appDesc.getDefaultSystemDescriptor().ifPresent(dsd -> systemStreamConfigs.put(JobConfig.JOB_DEFAULT_SYSTEM(), dsd.getSystemName())); return systemStreamConfigs; } }
@Override public TaskApplicationDescriptor withOutputStream(OutputDescriptor outputDescriptor) { addOutputDescriptor(outputDescriptor); getOrCreateStreamSerdes(outputDescriptor.getStreamId(), outputDescriptor.getSerde()); return this; }
final void addOutputDescriptor(OutputDescriptor outputDescriptor) { String streamId = outputDescriptor.getStreamId(); Preconditions.checkState(!outputDescriptors.containsKey(streamId) || outputDescriptors.get(streamId) == outputDescriptor, String.format("Cannot add an output descriptor multiple times with the same streamId: %s", streamId)); outputDescriptors.put(streamId, outputDescriptor); addSystemDescriptor(outputDescriptor.getSystemDescriptor()); }
private Map<String, String> generateSystemStreamConfigs(ApplicationDescriptorImpl<? extends ApplicationDescriptor> appDesc) { Map<String, String> systemStreamConfigs = new HashMap<>(); appDesc.getInputDescriptors().forEach((key, value) -> systemStreamConfigs.putAll(value.toConfig())); appDesc.getOutputDescriptors().forEach((key, value) -> systemStreamConfigs.putAll(value.toConfig())); appDesc.getSystemDescriptors().forEach(sd -> systemStreamConfigs.putAll(sd.toConfig())); appDesc.getDefaultSystemDescriptor().ifPresent(dsd -> systemStreamConfigs.put(JobConfig.JOB_DEFAULT_SYSTEM(), dsd.getSystemName())); return systemStreamConfigs; } }
@Override public TaskApplicationDescriptor withOutputStream(OutputDescriptor outputDescriptor) { addOutputDescriptor(outputDescriptor); getOrCreateStreamSerdes(outputDescriptor.getStreamId(), outputDescriptor.getSerde()); return this; }
final void addOutputDescriptor(OutputDescriptor outputDescriptor) { String streamId = outputDescriptor.getStreamId(); Preconditions.checkState(!outputDescriptors.containsKey(streamId) || outputDescriptors.get(streamId) == outputDescriptor, String.format("Cannot add an output descriptor multiple times with the same streamId: %s", streamId)); outputDescriptors.put(streamId, outputDescriptor); addSystemDescriptor(outputDescriptor.getSystemDescriptor()); }
private Map<String, String> generateSystemStreamConfigs(ApplicationDescriptorImpl<? extends ApplicationDescriptor> appDesc) { Map<String, String> systemStreamConfigs = new HashMap<>(); appDesc.getInputDescriptors().forEach((key, value) -> systemStreamConfigs.putAll(value.toConfig())); appDesc.getOutputDescriptors().forEach((key, value) -> systemStreamConfigs.putAll(value.toConfig())); appDesc.getSystemDescriptors().forEach(sd -> systemStreamConfigs.putAll(sd.toConfig())); appDesc.getDefaultSystemDescriptor().ifPresent(dsd -> systemStreamConfigs.put(JobConfig.JOB_DEFAULT_SYSTEM(), dsd.getSystemName())); return systemStreamConfigs; } }
@Override public TaskApplicationDescriptor withOutputStream(OutputDescriptor outputDescriptor) { addOutputDescriptor(outputDescriptor); getOrCreateStreamSerdes(outputDescriptor.getStreamId(), outputDescriptor.getSerde()); return this; }
final void addOutputDescriptor(OutputDescriptor outputDescriptor) { String streamId = outputDescriptor.getStreamId(); Preconditions.checkState(!outputDescriptors.containsKey(streamId) || outputDescriptors.get(streamId) == outputDescriptor, String.format("Cannot add an output descriptor multiple times with the same streamId: %s", streamId)); outputDescriptors.put(streamId, outputDescriptor); addSystemDescriptor(outputDescriptor.getSystemDescriptor()); }
private Map<String, String> generateSystemStreamConfigs(ApplicationDescriptorImpl<? extends ApplicationDescriptor> appDesc) { Map<String, String> systemStreamConfigs = new HashMap<>(); appDesc.getInputDescriptors().forEach((key, value) -> systemStreamConfigs.putAll(value.toConfig())); appDesc.getOutputDescriptors().forEach((key, value) -> systemStreamConfigs.putAll(value.toConfig())); appDesc.getSystemDescriptors().forEach(sd -> systemStreamConfigs.putAll(sd.toConfig())); appDesc.getDefaultSystemDescriptor().ifPresent(dsd -> systemStreamConfigs.put(JobConfig.JOB_DEFAULT_SYSTEM(), dsd.getSystemName())); return systemStreamConfigs; } }
@Override public <M> OutputStream<M> getOutputStream(OutputDescriptor<M, ?> outputDescriptor) { addOutputDescriptor(outputDescriptor); String streamId = outputDescriptor.getStreamId(); Serde serde = outputDescriptor.getSerde(); KV<Serde, Serde> kvSerdes = getOrCreateStreamSerdes(streamId, serde); boolean isKeyed = serde instanceof KVSerde; outputStreams.put(streamId, new OutputStreamImpl<>(streamId, kvSerdes.getKey(), kvSerdes.getValue(), isKeyed)); return outputStreams.get(streamId); }
private Map<String, String> generateSystemStreamConfigs(ApplicationDescriptorImpl<? extends ApplicationDescriptor> appDesc) { Map<String, String> systemStreamConfigs = new HashMap<>(); appDesc.getInputDescriptors().forEach((key, value) -> systemStreamConfigs.putAll(value.toConfig())); appDesc.getOutputDescriptors().forEach((key, value) -> systemStreamConfigs.putAll(value.toConfig())); appDesc.getSystemDescriptors().forEach(sd -> systemStreamConfigs.putAll(sd.toConfig())); appDesc.getDefaultSystemDescriptor().ifPresent(dsd -> systemStreamConfigs.put(JobConfig.JOB_DEFAULT_SYSTEM(), dsd.getSystemName())); return systemStreamConfigs; } }