public String getSystemName() { return this.systemDescriptor.getSystemName(); }
public String getSystemName() { return this.systemDescriptor.getSystemName(); }
private void addSystemDescriptor(SystemDescriptor systemDescriptor) { String systemName = systemDescriptor.getSystemName(); Preconditions.checkState(!systemDescriptors.containsKey(systemName) || systemDescriptors.get(systemName) == systemDescriptor, "Must not use different system descriptor instances for the same system name: " + systemName); systemDescriptors.put(systemName, systemDescriptor); } }
private void addSystemDescriptor(SystemDescriptor systemDescriptor) { String systemName = systemDescriptor.getSystemName(); Preconditions.checkState(!systemDescriptors.containsKey(systemName) || systemDescriptors.get(systemName) == systemDescriptor, "Must not use different system descriptor instances for the same system name: " + systemName); systemDescriptors.put(systemName, systemDescriptor); } }
private void addSystemDescriptor(SystemDescriptor systemDescriptor) { String systemName = systemDescriptor.getSystemName(); Preconditions.checkState(!systemDescriptors.containsKey(systemName) || systemDescriptors.get(systemName) == systemDescriptor, "Must not use different system descriptor instances for the same system name: " + systemName); systemDescriptors.put(systemName, systemDescriptor); } }
private void addSystemDescriptor(SystemDescriptor systemDescriptor) { String systemName = systemDescriptor.getSystemName(); Preconditions.checkState(!systemDescriptors.containsKey(systemName) || systemDescriptors.get(systemName) == systemDescriptor, "Must not use different system descriptor instances for the same system name: " + systemName); systemDescriptors.put(systemName, systemDescriptor); } }
private void addSystemDescriptor(SystemDescriptor systemDescriptor) { String systemName = systemDescriptor.getSystemName(); Preconditions.checkState(!systemDescriptors.containsKey(systemName) || systemDescriptors.get(systemName) == systemDescriptor, "Must not use different system descriptor instances for the same system name: " + systemName); systemDescriptors.put(systemName, systemDescriptor); } }
public Map<String, String> toConfig() { HashMap<String, String> configs = new HashMap<>(); this.factoryClassNameOptional.ifPresent(name -> configs.put(String.format(FACTORY_CONFIG_KEY, systemName), name)); this.defaultStreamOffsetDefaultOptional.ifPresent(dsod -> configs.put(String.format(DEFAULT_STREAM_OFFSET_DEFAULT_CONFIG_KEY, systemName), dsod.name().toLowerCase())); this.defaultStreamConfigs.forEach((key, value) -> configs.put(String.format(DEFAULT_STREAM_CONFIGS_CONFIG_KEY, getSystemName(), key), value)); this.systemConfigs.forEach((key, value) -> configs.put(String.format(SYSTEM_CONFIGS_CONFIG_KEY, getSystemName(), key), value)); return configs; } }
public Map<String, String> toConfig() { HashMap<String, String> configs = new HashMap<>(); this.factoryClassNameOptional.ifPresent(name -> configs.put(String.format(FACTORY_CONFIG_KEY, systemName), name)); this.defaultStreamOffsetDefaultOptional.ifPresent(dsod -> configs.put(String.format(DEFAULT_STREAM_OFFSET_DEFAULT_CONFIG_KEY, systemName), dsod.name().toLowerCase())); this.defaultStreamConfigs.forEach((key, value) -> configs.put(String.format(DEFAULT_STREAM_CONFIGS_CONFIG_KEY, getSystemName(), key), value)); this.systemConfigs.forEach((key, value) -> configs.put(String.format(SYSTEM_CONFIGS_CONFIG_KEY, getSystemName(), key), value)); return configs; } }
/** * Constructs a {@link StreamDescriptor} instance. * * @param streamId id of the stream * @param serde serde for messages in the stream * @param systemDescriptor system descriptor this stream descriptor was obtained from */ StreamDescriptor(String streamId, Serde serde, SystemDescriptor systemDescriptor) { Preconditions.checkArgument(systemDescriptor != null, String.format("SystemDescriptor must not be null. streamId: %s", streamId)); String systemName = systemDescriptor.getSystemName(); Preconditions.checkState(isValidStreamId(streamId), String.format("streamId must be non-empty and must not contain spaces or special characters. " + "streamId: %s, systemName: %s", streamId, systemName)); Preconditions.checkArgument(serde != null, String.format("Serde must not be null. streamId: %s systemName: %s", streamId, systemName)); this.streamId = streamId; this.serde = serde; this.systemDescriptor = systemDescriptor; }
/** * Constructs a {@link StreamDescriptor} instance. * * @param streamId id of the stream * @param serde serde for messages in the stream * @param systemDescriptor system descriptor this stream descriptor was obtained from */ StreamDescriptor(String streamId, Serde serde, SystemDescriptor systemDescriptor) { Preconditions.checkArgument(systemDescriptor != null, String.format("SystemDescriptor must not be null. streamId: %s", streamId)); String systemName = systemDescriptor.getSystemName(); Preconditions.checkState(isValidStreamId(streamId), String.format("streamId must be non-empty and must not contain spaces or special characters. " + "streamId: %s, systemName: %s", streamId, systemName)); Preconditions.checkArgument(serde != null, String.format("Serde must not be null. streamId: %s systemName: %s", streamId, systemName)); this.streamId = streamId; this.serde = serde; this.systemDescriptor = systemDescriptor; }
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; } }
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; } }
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; } }
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; } }
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; } }
@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)); }