2 * Copyright (c) 2024 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package io.atomix.storage.journal;
10 import io.netty.buffer.ByteBuf;
13 * A {@link ByteBufReader} traversing only committed entries.
15 final class SegmentedCommitsByteBufReader extends SegmentedByteBufReader {
16 SegmentedCommitsByteBufReader(final SegmentedByteBufJournal journal, final JournalSegment segment) {
17 super(journal, segment);
21 ByteBuf tryAdvance(final long index) {
22 return index <= journal.getCommitIndex() ? super.tryAdvance(index) : null;