vamossagar12 commented on a change in pull request #11959:
URL: https://github.com/apache/kafka/pull/11959#discussion_r837362482
##########
File path: streams/src/main/java/org/apache/kafka/streams/TopologyConfig.java
##########
@@ -136,37 +137,54 @@ public TopologyConfig(final String topologyName, final
StreamsConfig globalAppCo
maxBufferedSize = getInt(BUFFERED_RECORDS_PER_PARTITION_CONFIG);
log.info("Topology {} is overriding {} to {}", topologyName,
BUFFERED_RECORDS_PER_PARTITION_CONFIG, maxBufferedSize);
} else {
+ // If the user hasn't explicitly set the
buffered.records.per.partition config, then leave it unbounded
+ // and rely on the input.buffer.max.bytes instead to keep the
memory usage under control
maxBufferedSize =
globalAppConfigs.originals().containsKey(StreamsConfig.BUFFERED_RECORDS_PER_PARTITION_CONFIG)
?
globalAppConfigs.getInt(StreamsConfig.BUFFERED_RECORDS_PER_PARTITION_CONFIG) :
-1;
}
- if (isTopologyOverride(STATESTORE_CACHE_MAX_BYTES_CONFIG,
topologyOverrides) && isTopologyOverride(CACHE_MAX_BYTES_BUFFERING_CONFIG,
topologyOverrides)) {
- cacheSize = getLong(STATESTORE_CACHE_MAX_BYTES_CONFIG);
- log.info("Topology {} is using both deprecated config {} and new
config {}, hence {} is ignored and the new config {} (value {}) is used",
- topologyName,
- CACHE_MAX_BYTES_BUFFERING_CONFIG,
- STATESTORE_CACHE_MAX_BYTES_CONFIG,
- CACHE_MAX_BYTES_BUFFERING_CONFIG,
- STATESTORE_CACHE_MAX_BYTES_CONFIG,
- cacheSize);
- } else if (isTopologyOverride(CACHE_MAX_BYTES_BUFFERING_CONFIG,
topologyOverrides)) {
- cacheSize = getLong(CACHE_MAX_BYTES_BUFFERING_CONFIG);
- log.info("Topology {} is using only deprecated config {}, and will
be used to set cache size to {}; " +
- "we suggest setting the new config {} instead as
deprecated {} would be removed in the future.",
- topologyName,
- CACHE_MAX_BYTES_BUFFERING_CONFIG,
- cacheSize,
- STATESTORE_CACHE_MAX_BYTES_CONFIG,
- CACHE_MAX_BYTES_BUFFERING_CONFIG);
- } else if (isTopologyOverride(STATESTORE_CACHE_MAX_BYTES_CONFIG,
topologyOverrides)) {
- cacheSize = getLong(STATESTORE_CACHE_MAX_BYTES_CONFIG);
+ final boolean stateStoreCacheMaxBytesOverridden =
isTopologyOverride(STATESTORE_CACHE_MAX_BYTES_CONFIG, topologyOverrides);
Review comment:
@ableegoldman , another thing is my initial logic was similar to what
you have below (without the boolean variables stateStoreCacheMaxBytesOverridden
and cacheMaxBytesBufferingOverridden but I had to change it to the above one as
I was getting =>
```
[2022-03-29T06:53:02.757Z] [ant:checkstyle] [ERROR]
/home/jenkins/jenkins-agent/workspace/Kafka_kafka-pr_PR-11959/streams/src/main/java/org/apache/kafka/streams/TopologyConfig.java:127:5:
NPath Complexity is 960 (max allowed is 500). [NPathComplexity]
```
Looks like this PR suffers from the same problem.
--
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]