Skip to content

engine: change ModelVisitor.onField to take a FieldEvent - #2322

Open
jfallows wants to merge 1 commit into
developfrom
claude/zilla-plus-pii-status-nfzbgr
Open

engine: change ModelVisitor.onField to take a FieldEvent#2322
jfallows wants to merge 1 commit into
developfrom
claude/zilla-plus-pii-status-nfzbgr

Conversation

@jfallows

@jfallows jfallows commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Description

Replaces ModelVisitor.onField(String path, DirectBufferEx buffer, int index, int length) with onField(FieldEvent event), where FieldEvent exposes path() and an already-bounded value(). A new MutableFieldEvent gives 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 + its extracted() replay path)
  • KafkaCachePartition's key and header extraction (writeKey, the extractHeaders trailer builder)
  • The three model decoder pipelines (AvroModelDecoderPipeline, JsonModelDecoderPipeline, ProtobufModelDecoderPipeline)
  • TestModelPipeline
  • The corresponding unit tests in each of the above

ModelVisitor remains a @FunctionalInterface with a single abstract method, so NONE and every lambda-based caller still compile with a one-line signature change; no ModelVisitor implementer keeps the old 4-argument shape.

Testing

./mvnw install (with -Dskip.checks=true -DskipITs -Djacoco.skip=true locally to bypass unrelated infrastructure gates — notice-plugin license lookups and jacoco coverage checks on modules this change doesn't touch) for runtime/engine, runtime/model-core, runtime/model-avro, runtime/model-json, runtime/model-protobuf, and runtime/binding-kafka and their dependencies: 467 tests, 0 failures, 0 errors.

Fixes # (issue)


Generated by Claude Code

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants