kw2542 commented on a change in pull request #1251: SAMZA-2431: Fix the
checkpoint and changelog topic auto-creation.
URL: https://github.com/apache/samza/pull/1251#discussion_r366639912
##########
File path:
samza-kafka/src/main/java/org/apache/samza/system/kafka/KafkaSystemAdmin.java
##########
@@ -541,8 +541,11 @@ public KafkaStreamSpec toKafkaSpec(StreamSpec spec) {
new KafkaStreamSpec(spec.getId(), spec.getPhysicalName(),
systemName, 1, coordinatorStreamReplicationFactor,
coordinatorStreamProperties);
} else if (spec.isCheckpointStream()) {
- kafkaSpec =
KafkaStreamSpec.fromSpec(StreamSpec.createCheckpointStreamSpec(spec.getPhysicalName(),
systemName))
- .copyWithReplicationFactor(Integer.parseInt(new
KafkaConfig(config).getCheckpointReplicationFactor().get()));
+ Properties checkpointTopicProperties = new Properties();
+ checkpointTopicProperties.putAll(spec.getConfig());
+ kafkaSpec =
KafkaStreamSpec.fromSpec(StreamSpec.createCheckpointStreamSpec(spec.getPhysicalName(),
spec.getSystemName()))
+ .copyWithReplicationFactor(Integer.parseInt(new
KafkaConfig(config).getCheckpointReplicationFactor().get()))
+ .copyWithProperties(checkpointTopicProperties);
Review comment:
We can do it separately, can we add .copyWithConfig or .copyWithMap which
takes Config or Map<String, String> ?
copyWithProperties is not user friendly, as we are converting a Map/Config
to a properties, and this method basically convert it back.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services