engine: change ModelVisitor.onField to take a FieldEvent - #2322
Open
jfallows wants to merge 1 commit into
Open
Conversation
Replaces the (path, buffer, index, length) parameter list with a single FieldEvent exposing an already-bounded value, using a reusable wrapper (MutableFieldEvent) at every call site instead of separate offset/length bookkeeping. Updates the real callers and implementers this breaks: KafkaExtractor, KafkaCachePartition's key/header extraction, the three model decoder pipelines (Avro/JSON/Protobuf), TestModelPipeline, and their tests. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CzxN4tJLhiHQ8ikNeuN8WS
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.
Description
Replaces
ModelVisitor.onField(String path, DirectBufferEx buffer, int index, int length)withonField(FieldEvent event), whereFieldEventexposespath()and an already-boundedvalue(). A newMutableFieldEventgives callers a reusable, non-allocating flyweight to wrap before each call, following the same buffer-reuse convention already used throughout the codebase.This is a signature cleanup, not a behavior change — every call site is updated to match:
KafkaExtractor(implementation + itsextracted()replay path)KafkaCachePartition's key and header extraction (writeKey, theextractHeaderstrailer builder)AvroModelDecoderPipeline,JsonModelDecoderPipeline,ProtobufModelDecoderPipeline)TestModelPipelineModelVisitorremains a@FunctionalInterfacewith a single abstract method, soNONEand every lambda-based caller still compile with a one-line signature change; noModelVisitorimplementer keeps the old 4-argument shape.Testing
./mvnw install(with-Dskip.checks=true -DskipITs -Djacoco.skip=truelocally to bypass unrelated infrastructure gates — notice-plugin license lookups and jacoco coverage checks on modules this change doesn't touch) forruntime/engine,runtime/model-core,runtime/model-avro,runtime/model-json,runtime/model-protobuf, andruntime/binding-kafkaand their dependencies: 467 tests, 0 failures, 0 errors.Fixes # (issue)
Generated by Claude Code