Separate out FileAccess 34/111634/14
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 6 May 2024 03:23:11 +0000 (05:23 +0200)
committerRobert Varga <nite@hq.sk>
Thu, 9 May 2024 12:36:23 +0000 (12:36 +0000)
commit42dede415723eef0652dad54a2262bd8d8ba7c84
tree6ca77cd1049298e5922218a9157adbfea518ccc4
parentc3abf2298636dfc31f6d19eb4e3070fd57ecbae3
Separate out FileAccess

Rather than keeping mapping in MappedFileWriter, use MappedFileAccess
to keep its lifecycle.

The second part is keeping the information about last position, which
we encapsulate in JournalSegment.State and its two specializations.

Also move ByteBuffer allocator to DiskFileAccess, as it really is
specific to StorageLevel.DISK.

JIRA: CONTROLLER-2099
Change-Id: I7fba8da21a021a477c965d96045c1b0d4bf8cc29
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
atomix-storage/src/main/java/io/atomix/storage/journal/DiskFileAccess.java [new file with mode: 0644]
atomix-storage/src/main/java/io/atomix/storage/journal/DiskFileReader.java
atomix-storage/src/main/java/io/atomix/storage/journal/DiskFileWriter.java
atomix-storage/src/main/java/io/atomix/storage/journal/FileAccess.java [new file with mode: 0644]
atomix-storage/src/main/java/io/atomix/storage/journal/FileWriter.java
atomix-storage/src/main/java/io/atomix/storage/journal/JournalSegment.java
atomix-storage/src/main/java/io/atomix/storage/journal/JournalSegmentFile.java
atomix-storage/src/main/java/io/atomix/storage/journal/JournalSegmentWriter.java
atomix-storage/src/main/java/io/atomix/storage/journal/MappedFileAccess.java [new file with mode: 0644]
atomix-storage/src/main/java/io/atomix/storage/journal/MappedFileReader.java
atomix-storage/src/main/java/io/atomix/storage/journal/MappedFileWriter.java