refactor: drainableCount/backpressureLoad split, SchemaResolver.lookupRequired, SR Collection overloads - #296
Merged
Conversation
…ction overloads Three independent architecture-pass items (#10, #12, #13): - consumer: rename Dispatcher.activeCount() -> drainableCount() and KPipeConsumer.totalInFlight() -> backpressureLoad() so the names carry the invariant the old comment blocks kept re-litigating (drain waits on worker activity; backpressure also counts buffered batch records). Redundant warning docs collapsed to one-line summaries. Package-private surface only; the inFlight metric key and HealthSnapshot.inFlight are unchanged. - core: SchemaResolver.lookupRequired(int) default method enforces the no-null/no-blank contract with one uniform IllegalStateException; AvroFormat and ProtobufFormat drop their duplicated local checks. - api: KPipe.avro/protobuf(Collection<String>, Properties, SchemaResolver) overloads for homogeneous multi-topic SR consumers, mirroring the single-topic resolver overloads (registry-mode console sink rejected); docs/API.md notes updated.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #296 +/- ##
============================================
- Coverage 79.79% 79.61% -0.19%
+ Complexity 1075 1074 -1
============================================
Files 86 87 +1
Lines 3599 3606 +7
Branches 440 439 -1
============================================
- Hits 2872 2871 -1
- Misses 546 553 +7
- Partials 181 182 +1 ☔ View full report in Codecov by Harness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Architecture-pass items #10 + #12 + #13, three small independent fixes:
Dispatcher.activeCount()→drainableCount()(what shutdown drain waits on) andKPipeConsumer.totalInFlight()→backpressureLoad()(drainable + buffered batch records, what the watermark reads). The four comment blocks that re-litigated this distinction are deleted — the names now carry the invariant. Verified internal-only surface before renaming; theinFlightmetric key andHealthSnapshot.inFlightare untouched public surface.DispatcherActiveCountJCStressTest→DispatcherDrainableCountJCStressTest.SchemaResolver.lookupRequired(int)default owns the null/blank contract check both AvroFormat and ProtobufFormat duplicated verbatim; both formats collapse to one-liners. 4 new contract tests.Collection<String>overloads forKPipe.avro/protobuf(topics, props, resolver)— exact mirrors of the single-topic siblings incl. the correct unsupported-console factories; docs/API.md notes flipped. Facade build tests added (protobuf asserts the ServiceLoader delegation, per the established pattern for the deliberately-absent-confluenttest dependency).Suites green: core 89, consumer 425, api 88, avro 45, protobuf 40, jcstress compiles.