org.apache.ignite.internal.processors.cache.persistence.wal

## Class SingleSegmentLogicalRecordsIterator

- java.lang.Object
- - org.apache.ignite.internal.util.lang.GridIteratorAdapter<T>
  - - org.apache.ignite.internal.util.GridCloseableIteratorAdapter<IgniteBiTuple<WALPointer,WALRecord>>
    - - org.apache.ignite.internal.processors.cache.persistence.wal.AbstractWalRecordsIterator
      - - org.apache.ignite.internal.processors.cache.persistence.wal.SingleSegmentLogicalRecordsIterator

All Implemented Interfaces:
  Serializable, AutoCloseable, Iterable<IgniteBiTuple<WALPointer,WALRecord>>, Iterator<IgniteBiTuple<WALPointer,WALRecord>>, WALIterator, GridSerializableIterator<IgniteBiTuple<WALPointer,WALRecord>>, GridCloseableIterator<IgniteBiTuple<WALPointer,WALRecord>>, GridIterator<IgniteBiTuple<WALPointer,WALRecord>>, IgniteSpiCloseableIterator<IgniteBiTuple<WALPointer,WALRecord>>

    public class SingleSegmentLogicalRecordsIterator
    extends AbstractWalRecordsIterator

Iterates over logical records of one WAL segment from archive. Used for WAL archive compression. Doesn't deserialize actual record data, returns `MarshalledRecord` instances instead.

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class org.apache.ignite.internal.processors.cache.persistence.wal.AbstractWalRecordsIterator

`AbstractWalRecordsIterator.AbstractFileDescriptor, AbstractWalRecordsIterator.AbstractReadFileHandle`

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.cache.persistence.wal.AbstractWalRecordsIterator

`curRec, curWalSegmIdx, ioFactory, log, sharedCtx`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected void` `advance()` Switches records iterator to the next record.
`protected AbstractWalRecordsIterator.AbstractReadFileHandle` `advanceSegment(@Nullable AbstractWalRecordsIterator.AbstractReadFileHandle curWalSegment)` Switches records iterator to the next WAL segment as result of this method, new reference to segment should be returned.
`protected AbstractWalRecordsIterator.AbstractReadFileHandle` `createReadFileHandle(SegmentIO fileIO, RecordSerializer ser, FileInput in)`

### Methods inherited from class org.apache.ignite.internal.processors.cache.persistence.wal.AbstractWalRecordsIterator

`advanceRecord, closeCurrentWalSegment, handleRecordException, initReadHandle, initReadHandle, lastRead, onClose, onHasNext, onNext, postProcessRecord, validateTailReachedException`

### Methods inherited from class org.apache.ignite.internal.util.GridCloseableIteratorAdapter

`checkClosed, close, hasNextX, isClosed, nextX, onRemove, removeX`

### Methods inherited from class org.apache.ignite.internal.util.lang.GridIteratorAdapter

`hasNext, iterator, next, remove`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.apache.ignite.internal.util.lang.GridCloseableIterator

`close, isClosed`

### Methods inherited from interface org.apache.ignite.internal.util.lang.GridIterator

`hasNextX, nextX, removeX`

### Methods inherited from interface java.lang.Iterable

`forEach, iterator, spliterator`

### Methods inherited from interface java.util.Iterator

`forEachRemaining, hasNext, next, remove`

### Method Detail

#### advanceSegment

    protected AbstractWalRecordsIterator.AbstractReadFileHandle advanceSegment(@Nullable
                                                                               @Nullable AbstractWalRecordsIterator.AbstractReadFileHandle curWalSegment)
                                                                        throws IgniteCheckedException

Switches records iterator to the next WAL segment as result of this method, new reference to segment should be returned. Null for current handle means stop of iteration.

Specified by:
  `advanceSegment` in class `AbstractWalRecordsIterator`
Parameters:
  `curWalSegment` - current open WAL segment or null if there is no open segment yet
Returns:
  new WAL segment to read or null for stop iteration
Throws:
  `IgniteCheckedException` - if reading failed

#### advance

    protected void advance()
                    throws IgniteCheckedException

Switches records iterator to the next record.

- `AbstractWalRecordsIterator.curRec` will be updated.
- If end of segment reached, switch to new segment is called. `AbstractWalRecordsIterator.currWalSegment` will be updated.

`advance()` runs a step ahead `GridIteratorAdapter.next()`

Overrides:
  `advance` in class `AbstractWalRecordsIterator`
Throws:
  `IgniteCheckedException` - If failed.

#### createReadFileHandle

    protected AbstractWalRecordsIterator.AbstractReadFileHandle createReadFileHandle(SegmentIO fileIO,
                                                                                     RecordSerializer ser,
                                                                                     FileInput in)

Specified by:
  `createReadFileHandle` in class `AbstractWalRecordsIterator`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.8.1
Release Date | : May 21 2020