Repository navigation
Hadoop uses a blockHeaderSize of 8 instead of the normal 4 - #768
Merged
Merged
Conversation
pan3793
reviewed
Oct 10, 2026
| { | ||
| int maxCompressedSize = Snappy.maxCompressedLength(inputSize); | ||
| return maxCompressedSize < outputBuffer.length - outputCursor - 4; | ||
| return maxCompressedSize < outputBuffer.length - outputCursor - blockHeaderSize(); |
There was a problem hiding this comment.
might be <= ?
< is conservative by 1 byte and can't trigger the exception; <= is the exact bound and saves a separate header flush on the first block. Not blocking.
pan3793
reviewed
Oct 10, 2026
| } | ||
|
|
||
| @Override | ||
| protected int blockHeaderSize() { |
There was a problem hiding this comment.
it looks like this repo prefers to put the { on the next line
|
can you add a UT which has been mentioned in your issue |
Writes a full incompressible block followed by trailing blocks of every size and decodes the Hadoop block format, covering the case where the output buffer had only 4-8 bytes of slack for the 8-byte block header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes a bug in the Hadoop compression where sometime you get the error
IllegalArgumentException("not enough space for output: need %,d bytes, but only %,d remaining");see this issue #767Fixed by changing how on hadoop what the buffer size should be.