Improve FileChannelJournalSegmentWriter.truncate() 63/110563/3
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 9 Mar 2024 12:30:12 +0000 (13:30 +0100)
committerRobert Varga <nite@hq.sk>
Mon, 11 Mar 2024 12:51:11 +0000 (12:51 +0000)
commitb2106c7c4fbc91f6cdfd8bf4371b723db6fdae2f
tree4f17c42489d1a2c5558e7fe88307cfc7c0d4a6cc
parentc15f343c9fdf01aaff0170c58398d0b8a7259822
Improve FileChannelJournalSegmentWriter.truncate()

Reduce the dance around channel position by explicitly passing it down,
thus reducing the number of syscalls we incur.

Also inline FileChannelJournalSegmentWriter.zero() and add a FIXME to
improve our zero-out strategy.

JIRA: CONTROLLER-2095
Change-Id: I885947fef51132a294c900396d902cf5481e2bd8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
atomix-storage/src/main/java/io/atomix/storage/journal/FileChannelJournalSegmentWriter.java