This method is only invoked from the constructor, inline it there to
similify lifecycle.
JIRA: CONTROLLER-2098
Change-Id: I2c2790f785e13dd411a23eff299221b129a99630
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
* Raft log reader.
*/
public class SegmentedJournalReader<E> implements JournalReader<E> {
-
private final SegmentedJournal<E> journal;
private JournalSegment<E> currentSegment;
private Indexed<E> previousEntry;
public SegmentedJournalReader(SegmentedJournal<E> journal, long index, Mode mode) {
this.journal = journal;
this.mode = mode;
- initialize(index);
- }
-
- /**
- * Initializes the reader to the given index.
- */
- private void initialize(long index) {
currentSegment = journal.getSegment(index);
currentSegment.acquire();
currentReader = currentSegment.createReader();