Inline SegmentedJournalReader.initialize() 81/110581/2
authorRobert Varga <robert.varga@pantheon.tech>
Sun, 10 Mar 2024 18:25:50 +0000 (19:25 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 11 Mar 2024 12:51:31 +0000 (13:51 +0100)
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>
atomix-storage/src/main/java/io/atomix/storage/journal/SegmentedJournalReader.java

index 799f395ceb565a74926ca2c5ba44994444540ce6..3b19f4ea3b1ff1fdc5013eb4e1c42fcd1ac50626 100644 (file)
@@ -21,7 +21,6 @@ import java.util.NoSuchElementException;
  * Raft log reader.
  */
 public class SegmentedJournalReader<E> implements JournalReader<E> {
-
   private final SegmentedJournal<E> journal;
   private JournalSegment<E> currentSegment;
   private Indexed<E> previousEntry;
@@ -31,13 +30,6 @@ public class SegmentedJournalReader<E> implements JournalReader<E> {
   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();