ableegoldman commented on a change in pull request #11959:
URL: https://github.com/apache/kafka/pull/11959#discussion_r837858510
##########
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:
Ah :/
I think this is a case where it's reasonable to suppress this checkstyle
exception, as the NPath complexity is sort of "artificially" complex, ie the
code is easy to follow it just has many branches because it goes through each
config
--
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]