TIKA-4829 -- handle byte passing more cleanly - #3043
Open
tballison wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Tika Pipes IPC (Smile) serialization path so inline document bytes travel efficiently as raw binary at the tuple top level (instead of being forced through ParseContext’s JSON-config round trip), and reduces wire overhead by disabling Smile’s default 7-bit binary encoding.
Changes:
- Add a dedicated
inlineBytestop-level binary field toFetchEmitTupleIPC serialization/deserialization, keeping the payload out of ParseContext JSON config handling. - Configure the IPC
SmileFactoryto disableENCODE_BINARY_AS_7BITto avoid size expansion and transcoding overhead for binary payloads. - Add targeted unit tests and a
CHANGES.txtentry covering the new wire behavior and request-body rejection ofinlineBytes.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tika-pipes/tika-pipes-core/src/test/java/org/apache/tika/pipes/core/serialization/InlineBytesWireTest.java |
Adds tests validating raw-binary carriage over IPC, ParseContext isolation, and request-body rejection. |
tika-pipes/tika-pipes-core/src/main/java/org/apache/tika/pipes/core/serialization/JsonPipesIpc.java |
Disables Smile 7-bit binary encoding for IPC serialization to reduce overhead. |
tika-pipes/tika-pipes-core/src/main/java/org/apache/tika/pipes/core/serialization/FetchEmitTupleSerializer.java |
Writes inline payload as a top-level binary field and removes it from the serialized ParseContext. |
tika-pipes/tika-pipes-core/src/main/java/org/apache/tika/pipes/core/serialization/FetchEmitTupleDeserializer.java |
Reads inline payload from the new top-level field into typed ParseContext and rejects it for restricted (request) inputs. |
tika-pipes/tika-pipes-core/src/main/java/org/apache/tika/pipes/core/fetcher/InlineBytes.java |
Updates class-level documentation to describe the new IPC wire behavior. |
CHANGES.txt |
Documents the IPC wire-format change and Smile encoding adjustment under 4.1.0. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Thanks for your contribution to Apache Tika! Your help is appreciated!
Before opening the pull request, please verify that
TIKA-XXXX)[TIKA-XXXX] Issue or pull request title)./mvnw clean testmainbranch. If there are conflicts, please try to rebase the pull request branch on top of a freshly pulledmainbranchtika-bom/pom.xml.We will be able to faster integrate your pull request if these conditions are met. If you have any questions how to fix your problem or about using Tika in general, please sign up for the Tika mailing list. Thanks!