final void addInputDescriptor(InputDescriptor inputDescriptor) { String streamId = inputDescriptor.getStreamId(); Preconditions.checkState(!inputDescriptors.containsKey(streamId) || inputDescriptors.get(streamId) == inputDescriptor, String.format("Cannot add multiple input descriptors with the same streamId: %s", streamId)); inputDescriptors.put(streamId, inputDescriptor); addSystemDescriptor(inputDescriptor.getSystemDescriptor()); }
final void addInputDescriptor(InputDescriptor inputDescriptor) { String streamId = inputDescriptor.getStreamId(); Preconditions.checkState(!inputDescriptors.containsKey(streamId) || inputDescriptors.get(streamId) == inputDescriptor, String.format("Cannot add multiple input descriptors with the same streamId: %s", streamId)); inputDescriptors.put(streamId, inputDescriptor); addSystemDescriptor(inputDescriptor.getSystemDescriptor()); }
final void addInputDescriptor(InputDescriptor inputDescriptor) { String streamId = inputDescriptor.getStreamId(); Preconditions.checkState(!inputDescriptors.containsKey(streamId) || inputDescriptors.get(streamId) == inputDescriptor, String.format("Cannot add multiple input descriptors with the same streamId: %s", streamId)); inputDescriptors.put(streamId, inputDescriptor); addSystemDescriptor(inputDescriptor.getSystemDescriptor()); }
final void addInputDescriptor(InputDescriptor inputDescriptor) { String streamId = inputDescriptor.getStreamId(); Preconditions.checkState(!inputDescriptors.containsKey(streamId) || inputDescriptors.get(streamId) == inputDescriptor, String.format("Cannot add multiple input descriptors with the same streamId: %s", streamId)); inputDescriptors.put(streamId, inputDescriptor); addSystemDescriptor(inputDescriptor.getSystemDescriptor()); }
final void addInputDescriptor(InputDescriptor inputDescriptor) { String streamId = inputDescriptor.getStreamId(); Preconditions.checkState(!inputDescriptors.containsKey(streamId) || inputDescriptors.get(streamId) == inputDescriptor, String.format("Cannot add multiple input descriptors with the same streamId: %s", streamId)); inputDescriptors.put(streamId, inputDescriptor); addSystemDescriptor(inputDescriptor.getSystemDescriptor()); }
@Override public Map<String, String> toConfig() { HashMap<String, String> configs = new HashMap<>(super.toConfig()); String streamId = getStreamId(); this.offsetDefaultOptional.ifPresent(od -> configs.put(String.format(OFFSET_DEFAULT_CONFIG_KEY, streamId), od.name().toLowerCase())); this.resetOffsetOptional.ifPresent(resetOffset -> configs.put(String.format(RESET_OFFSET_CONFIG_KEY, streamId), Boolean.toString(resetOffset))); this.priorityOptional.ifPresent(priority -> configs.put(String.format(PRIORITY_CONFIG_KEY, streamId), Integer.toString(priority))); this.isBootstrapOptional.ifPresent(bootstrap -> configs.put(String.format(BOOTSTRAP_CONFIG_KEY, streamId), Boolean.toString(bootstrap))); this.isBoundedOptional.ifPresent(bounded -> configs.put(String.format(BOUNDED_CONFIG_KEY, streamId), Boolean.toString(bounded))); this.deleteCommittedMessagesOptional.ifPresent(deleteCommittedMessages -> configs.put(String.format(DELETE_COMMITTED_MESSAGES_CONFIG_KEY, streamId), Boolean.toString(deleteCommittedMessages))); return Collections.unmodifiableMap(configs); } }
@Override public Map<String, String> toConfig() { HashMap<String, String> configs = new HashMap<>(super.toConfig()); String streamId = getStreamId(); this.offsetDefaultOptional.ifPresent(od -> configs.put(String.format(OFFSET_DEFAULT_CONFIG_KEY, streamId), od.name().toLowerCase())); this.resetOffsetOptional.ifPresent(resetOffset -> configs.put(String.format(RESET_OFFSET_CONFIG_KEY, streamId), Boolean.toString(resetOffset))); this.priorityOptional.ifPresent(priority -> configs.put(String.format(PRIORITY_CONFIG_KEY, streamId), Integer.toString(priority))); this.isBootstrapOptional.ifPresent(bootstrap -> configs.put(String.format(BOOTSTRAP_CONFIG_KEY, streamId), Boolean.toString(bootstrap))); this.isBoundedOptional.ifPresent(bounded -> configs.put(String.format(BOUNDED_CONFIG_KEY, streamId), Boolean.toString(bounded))); this.deleteCommittedMessagesOptional.ifPresent(deleteCommittedMessages -> configs.put(String.format(DELETE_COMMITTED_MESSAGES_CONFIG_KEY, streamId), Boolean.toString(deleteCommittedMessages))); return Collections.unmodifiableMap(configs); } }
@Override public TaskApplicationDescriptor withInputStream(InputDescriptor inputDescriptor) { // TODO: SAMZA-1841: need to add to the broadcast streams if inputDescriptor is for a broadcast stream addInputDescriptor(inputDescriptor); getOrCreateStreamSerdes(inputDescriptor.getStreamId(), inputDescriptor.getSerde()); return this; }
@Override public TaskApplicationDescriptor withInputStream(InputDescriptor inputDescriptor) { // TODO: SAMZA-1841: need to add to the broadcast streams if inputDescriptor is for a broadcast stream addInputDescriptor(inputDescriptor); getOrCreateStreamSerdes(inputDescriptor.getStreamId(), inputDescriptor.getSerde()); return this; }
@Override public TaskApplicationDescriptor withInputStream(InputDescriptor inputDescriptor) { // TODO: SAMZA-1841: need to add to the broadcast streams if inputDescriptor is for a broadcast stream addInputDescriptor(inputDescriptor); getOrCreateStreamSerdes(inputDescriptor.getStreamId(), inputDescriptor.getSerde()); return this; }
@Override public TaskApplicationDescriptor withInputStream(InputDescriptor inputDescriptor) { // TODO: SAMZA-1841: need to add to the broadcast streams if inputDescriptor is for a broadcast stream addInputDescriptor(inputDescriptor); getOrCreateStreamSerdes(inputDescriptor.getStreamId(), inputDescriptor.getSerde()); return this; }
@Override public TaskApplicationDescriptor withInputStream(InputDescriptor inputDescriptor) { // TODO: SAMZA-1841: need to add to the broadcast streams if inputDescriptor is for a broadcast stream addInputDescriptor(inputDescriptor); getOrCreateStreamSerdes(inputDescriptor.getStreamId(), inputDescriptor.getSerde()); return this; }
@Override public <M> MessageStream<M> getInputStream(InputDescriptor<M, ?> inputDescriptor) { SystemDescriptor systemDescriptor = inputDescriptor.getSystemDescriptor(); Optional<StreamExpander> expander = systemDescriptor.getExpander(); if (expander.isPresent()) { return expander.get().apply(this, inputDescriptor); } // TODO: SAMZA-1841: need to add to the broadcast streams if inputDescriptor is for a broadcast stream addInputDescriptor(inputDescriptor); String streamId = inputDescriptor.getStreamId(); Serde serde = inputDescriptor.getSerde(); KV<Serde, Serde> kvSerdes = getOrCreateStreamSerdes(streamId, serde); boolean isKeyed = serde instanceof KVSerde; InputTransformer transformer = inputDescriptor.getTransformer().orElse(null); InputOperatorSpec inputOperatorSpec = OperatorSpecs.createInputOperatorSpec(streamId, kvSerdes.getKey(), kvSerdes.getValue(), transformer, isKeyed, this.getNextOpId(OpCode.INPUT, null)); inputOperators.put(streamId, inputOperatorSpec); return new MessageStreamImpl(this, inputOperators.get(streamId)); }
@Override public <M> MessageStream<M> getInputStream(InputDescriptor<M, ?> inputDescriptor) { SystemDescriptor systemDescriptor = inputDescriptor.getSystemDescriptor(); Optional<StreamExpander> expander = systemDescriptor.getExpander(); if (expander.isPresent()) { return expander.get().apply(this, inputDescriptor); } // TODO: SAMZA-1841: need to add to the broadcast streams if inputDescriptor is for a broadcast stream addInputDescriptor(inputDescriptor); String streamId = inputDescriptor.getStreamId(); Serde serde = inputDescriptor.getSerde(); KV<Serde, Serde> kvSerdes = getOrCreateStreamSerdes(streamId, serde); boolean isKeyed = serde instanceof KVSerde; InputTransformer transformer = inputDescriptor.getTransformer().orElse(null); InputOperatorSpec inputOperatorSpec = OperatorSpecs.createInputOperatorSpec(streamId, kvSerdes.getKey(), kvSerdes.getValue(), transformer, isKeyed, this.getNextOpId(OpCode.INPUT, null)); inputOperators.put(streamId, inputOperatorSpec); return new MessageStreamImpl(this, inputOperators.get(streamId)); }
@Override public <M> MessageStream<M> getInputStream(InputDescriptor<M, ?> inputDescriptor) { SystemDescriptor systemDescriptor = inputDescriptor.getSystemDescriptor(); Optional<StreamExpander> expander = systemDescriptor.getExpander(); if (expander.isPresent()) { return expander.get().apply(this, inputDescriptor); } // TODO: SAMZA-1841: need to add to the broadcast streams if inputDescriptor is for a broadcast stream addInputDescriptor(inputDescriptor); String streamId = inputDescriptor.getStreamId(); Serde serde = inputDescriptor.getSerde(); KV<Serde, Serde> kvSerdes = getOrCreateStreamSerdes(streamId, serde); boolean isKeyed = serde instanceof KVSerde; InputTransformer transformer = inputDescriptor.getTransformer().orElse(null); InputOperatorSpec inputOperatorSpec = OperatorSpecs.createInputOperatorSpec(streamId, kvSerdes.getKey(), kvSerdes.getValue(), transformer, isKeyed, this.getNextOpId(OpCode.INPUT, null)); inputOperators.put(streamId, inputOperatorSpec); return new MessageStreamImpl(this, inputOperators.get(streamId)); }
@Override public <M> MessageStream<M> getInputStream(InputDescriptor<M, ?> inputDescriptor) { SystemDescriptor systemDescriptor = inputDescriptor.getSystemDescriptor(); Optional<StreamExpander> expander = systemDescriptor.getExpander(); if (expander.isPresent()) { return expander.get().apply(this, inputDescriptor); } // TODO: SAMZA-1841: need to add to the broadcast streams if inputDescriptor is for a broadcast stream addInputDescriptor(inputDescriptor); String streamId = inputDescriptor.getStreamId(); Serde serde = inputDescriptor.getSerde(); KV<Serde, Serde> kvSerdes = getOrCreateStreamSerdes(streamId, serde); boolean isKeyed = serde instanceof KVSerde; InputTransformer transformer = inputDescriptor.getTransformer().orElse(null); InputOperatorSpec inputOperatorSpec = OperatorSpecs.createInputOperatorSpec(streamId, kvSerdes.getKey(), kvSerdes.getValue(), transformer, isKeyed, this.getNextOpId(OpCode.INPUT, null)); inputOperators.put(streamId, inputOperatorSpec); return new MessageStreamImpl(this, inputOperators.get(streamId)); }
@Override public <M> MessageStream<M> getInputStream(InputDescriptor<M, ?> inputDescriptor) { SystemDescriptor systemDescriptor = inputDescriptor.getSystemDescriptor(); Optional<StreamExpander> expander = systemDescriptor.getExpander(); if (expander.isPresent()) { return expander.get().apply(this, inputDescriptor); } // TODO: SAMZA-1841: need to add to the broadcast streams if inputDescriptor is for a broadcast stream addInputDescriptor(inputDescriptor); String streamId = inputDescriptor.getStreamId(); Serde serde = inputDescriptor.getSerde(); KV<Serde, Serde> kvSerdes = getOrCreateStreamSerdes(streamId, serde); boolean isKeyed = serde instanceof KVSerde; InputTransformer transformer = inputDescriptor.getTransformer().orElse(null); InputOperatorSpec inputOperatorSpec = OperatorSpecs.createInputOperatorSpec(streamId, kvSerdes.getKey(), kvSerdes.getValue(), transformer, isKeyed, this.getNextOpId(OpCode.INPUT, null)); inputOperators.put(streamId, inputOperatorSpec); return new MessageStreamImpl(this, inputOperators.get(streamId)); }