guozhangwang commented on code in PR #12641:
URL: https://github.com/apache/kafka/pull/12641#discussion_r972339213
##########
streams/src/test/java/org/apache/kafka/streams/StreamsConfigTest.java:
##########
@@ -1263,6 +1263,54 @@ public void testInvalidSecurityProtocol() {
assertTrue(ce.getMessage().contains(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG));
}
+ @Test
+ public void shouldThrowExceptionWhenTopologyOptimizationOnAndOff() {
+ final String value = String.join(",", StreamsConfig.OPTIMIZE,
StreamsConfig.NO_OPTIMIZATION);
+ props.put(TOPOLOGY_OPTIMIZATION_CONFIG, value);
+ final ConfigException exception = assertThrows(ConfigException.class,
() -> new StreamsConfig(props));
+ assertTrue(exception.getMessage().contains("A topology can either not
be optimized with"));
+ }
+
+ @Test
+ public void shouldThrowExceptionWhenTopologyOptimizationOffAndSet() {
+ final String value = String.join(",", StreamsConfig.NO_OPTIMIZATION,
StreamsConfig.REUSE_KTABLE_SOURCE_TOPICS);
+ props.put(TOPOLOGY_OPTIMIZATION_CONFIG, value);
+ final ConfigException exception = assertThrows(ConfigException.class,
() -> new StreamsConfig(props));
+ assertTrue(exception.getMessage().contains("A topology can either not
be optimized with"));
+ }
+
+ @Test
+ public void shouldThrowExceptionWhenOptimizationDoesNotExist() {
Review Comment:
What's the main difference between
`shouldThrowExceptionWhenOptimizationDoesNotExist` and
`shouldThrowExceptionWhenTopologyOptimizationDoesNotExist`? Could they be just
one test?
##########
streams/src/main/java/org/apache/kafka/streams/StreamsConfig.java:
##########
@@ -243,6 +254,22 @@ public class StreamsConfig extends AbstractConfig {
*/
public static final String OPTIMIZE = "all";
+ /**
+ * Config value for parameter {@link #TOPOLOGY_OPTIMIZATION_CONFIG
"topology.optimization"}
+ * for enabling the specific optimization that reuses source topic as
changelog topic
+ * for KTables.
+ */
+ public static final String REUSE_KTABLE_SOURCE_TOPICS =
"topology.optimization.reuse.ktable.source.topics";
Review Comment:
In the KIP, seems we do not have the `topology.optimization.` prefix for
such values? Also I personally feel that we do not need those prefixes since
for users who do want to list specific rules, they would become too long.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]