Simplify FileChannelJournalSegmentWriter position tracking 72/110572/3
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 9 Mar 2024 17:13:01 +0000 (18:13 +0100)
committerRobert Varga <nite@hq.sk>
Mon, 11 Mar 2024 12:51:11 +0000 (12:51 +0000)
commit7dd119a473054c089c12e66780b136f11eb4f5d2
treeef4b88fce54287753dc62be0840a49a50ec3e480
parentb8dfbae75d8e13b78d3a7d5db48de2f5e262cd87
Simplify FileChannelJournalSegmentWriter position tracking

This patch makes the obvious switch in state tracking: memory buffer
does not hold anything of value w.r.t. overall state, so there is no
point in marking/resetting and maintaining memory.position() beyond
what we need for reading from it.

Local 'position' acts now as the authoritative source of where we want
to go and we propagate it to channel position when we validate an entry.

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