Reduce position changes during read 02/110602/1
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 9 Mar 2024 14:29:56 +0000 (15:29 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 11 Mar 2024 13:36:22 +0000 (14:36 +0100)
commitd6b0d06ade90144953ce755346616298c77b8d15
tree7b5b821243058d5ea08b031d85cca9aad4fa91f7
parent561dc5c60c05a6a9b9c93746e8b014d6aec3c304
Reduce position changes during read

Rather than using a read() which updates the position, requiring us to
set the position again, set it only once and use read with offset --
eliminating one syscall.

JIRA: CONTROLLER-2095
Change-Id: I478ba1cbb1f5737a751b43cb6ed0d018e49e6485
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit fe1081dadbe4aa27600ef4454bbad5357f50e331)
atomix-storage/src/main/java/io/atomix/storage/journal/FileChannelJournalSegmentWriter.java