Source:
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); } String streamId = inputDescriptor.getStreamId(); Preconditions.checkState(!inputOperators.containsKey(streamId), "getInputStream must not be called multiple times with the same streamId: " + streamId); Preconditions.checkState(!inputDescriptors.containsKey(streamId), "getInputStream must not be called multiple times with the same input descriptor: " + streamId); String systemName = systemDescriptor.getSystemName(); checkSystemDescriptorUniqueness(systemDescriptor, systemName); Serde serde = inputDescriptor.getSerde(); KV<Serde, Serde> kvSerdes = getKVSerdes(streamId, serde); if (outputStreams.containsKey(streamId)) { OutputStreamImpl outputStream = outputStreams.get(streamId); Serde keySerde = (Serde) outputStream.getKeySerde().orElse(null); Serde valueSerde = (Serde) outputStream.getValueSerde().orElse(null); Preconditions.checkState(kvSerdes.getKey().equals(keySerde) && kvSerdes.getValue().equals(valueSerde), String.format("Stream %s is being used both as an input and an output stream. Serde in Samza happens at " + "stream level, so the same key and message Serde must be used for both.", streamId)); } 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); inputDescriptors.put(streamId, inputDescriptor); systemDescriptors.put(systemDescriptor.getSystemName(), systemDescriptor); return new MessageStreamImpl(this, inputOperators.get(streamId)); }

Target:
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); } String streamId = inputDescriptor.getStreamId(); Preconditions.checkState(!inputOperators.containsKey(streamId), "getInputStream must not be called multiple times with the same streamId: " + streamId); Preconditions.checkState(!inputDescriptors.containsKey(streamId), "getInputStream must not be called multiple times with the same input descriptor: " + streamId); String systemName = systemDescriptor.getSystemName(); checkSystemDescriptorUniqueness(systemDescriptor, systemName); Serde serde = inputDescriptor.getSerde(); KV<Serde, Serde> kvSerdes = getKVSerdes(streamId, serde); if (outputStreams.containsKey(streamId)) { OutputStreamImpl outputStream = outputStreams.get(streamId); Serde keySerde = outputStream.getKeySerde(); Serde valueSerde = outputStream.getValueSerde(); Preconditions.checkState(kvSerdes.getKey().equals(keySerde) && kvSerdes.getValue().equals(valueSerde), String.format("Stream %s is being used both as an input and an output stream. Serde in Samza happens at " + "stream level, so the same key and message Serde must be used for both.", streamId)); } 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); inputDescriptors.put(streamId, inputDescriptor); systemDescriptors.put(systemDescriptor.getSystemName(), systemDescriptor); return new MessageStreamImpl(this, inputOperators.get(streamId)); }