Perform proper handoff between JournalSegmentWriters 76/110576/3
authorRobert Varga <robert.varga@pantheon.tech>
Sun, 10 Mar 2024 13:27:28 +0000 (14:27 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 11 Mar 2024 12:51:31 +0000 (13:51 +0100)
commitf9698667f48360df0d039e95db709fb140cf9e24
treea79d285e7d3cc9b3da926d600eefe255c4276ad2
parentd9569bc53baaf2e830144e0200f7b6baba15cbe0
Perform proper handoff between JournalSegmentWriters

Switching between JournalSegmentWriter implementations is a matter of
just handing off state, which is limited to the last entry and position
in the file.

This patch introduces alternative constructors, which allow this state
to be moved to the new implementation without needing to re-read the
file.

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