Skip to content
Commit 0dbb6681 authored by Michael Berlin's avatar Michael Berlin
Browse files

foundation: ReusableBuffer: The fix in revision 4709359b was incomplete...

foundation: ReusableBuffer: The fix in revision 4709359b was incomplete and introduced three regressions.

1st regression: position() and limit() were not independent of the parent buffer. For example, this broke the RAID0ObjectMapper code which uses view buffers when aligning chunks for write requests.

2nd regression: position() did not start at 0 (while the size was correct and equaled length-offset). The RPC layer did not cope with this problem.

These two problems were fixed by creating the view buffer using java.nio.ByteBuffer#slice().

3rd regression: range(int, int), shrink(int) and enlarge(int) threw NullPointerException when the view buffer was no longer backed by a reusable buffer.

Extended the code accordingly and wrote unit tests which cover all known cases.
parent 9d19f07a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment