Lower reader buffering 02/111002/8
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 23 Mar 2024 22:41:35 +0000 (23:41 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 25 Mar 2024 09:40:34 +0000 (10:40 +0100)
commit5d2fc1dda3869fd05bbc231f1de1791bba65c7c0
treee1980658081da0bcdd5e03a30baa2335337b890f
parent323f56b4c4da7a19313dff1e35a60cf5e18f5942
Lower reader buffering

We are choosing buffer for two entries. This is a legacy choice, when we
could not compact our buffer and is actively hostile to large
maxEntrySize.

At the end of the day we really need space for one full entry. Since we
are being smart re. buffer management, we do not need the doubled buffer
size -- so allocate just what we need.

One exemption is when the buffer would be less than 8KiB -- in that case
just do not bother and cache up to 8KiB as needed.

JIRA: CONTROLLER-2109
Change-Id: Ic03df7e271e59588608f07c097b3831db83d7bd7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
atomix-storage/src/main/java/io/atomix/storage/journal/DiskFileReader.java
atomix-storage/src/main/java/io/atomix/storage/journal/JournalSegment.java