You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Invert resolver dep: take AdminClient factory in constructor instead
of building inside resolve(). Removes the package-private test-only
constructor and lets the test mock the actual external (AdminClient)
while exercising the real DynamicStreamThreadsCountCalculator.
- Drop @mock on the calculator in the resolver test; route stubs
through AdminClient.describeTopics(...) so the test asserts on the
real partition→threads math instead of stubbed return values.
- Narrow catch (Throwable) to catch (Exception) in
resolveDynamicStreamThreads so JVM Errors (OOM, LinkageError) keep
surfacing instead of being silently swallowed at startup.
- Return OptionalInt from resolveDynamicStreamThreads and apply the
override at the doInit() call site, so the helper no longer mutates
the caller's map under a query-shaped name.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: kafka-streams-framework/src/main/java/org/hypertrace/core/kafkastreams/framework/threading/StreamThreadsCountResolver.java
+9-4Lines changed: 9 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@
3
3
importjava.util.Map;
4
4
importjava.util.Optional;
5
5
importjava.util.Properties;
6
+
importjava.util.function.Function;
6
7
importjava.util.function.IntSupplier;
7
8
importorg.apache.kafka.clients.admin.AdminClient;
8
9
importorg.apache.kafka.streams.Topology;
@@ -27,16 +28,19 @@ public class StreamThreadsCountResolver {
0 commit comments