Clean up SegmentedJournalReader 83/110583/2
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 11 Mar 2024 07:44:57 +0000 (08:44 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 11 Mar 2024 12:51:31 +0000 (13:51 +0100)
commitc23fa167527d507fe778e3ac838000edd9a81af3
tree155a966d074c67425090c1d91deb7ba656c13492
parent8442a2fb1750d67970672c484fa77f413692ff8c
Clean up SegmentedJournalReader

We have bit of duplicated code dealing with moving to next segment.
Concentrate it to a single method.

This shows the code actually has a bug, where it fails to close the
reader -- hence potentially leaking.

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