public abstract class AbstractWalRecordsIterator extends GridCloseableIteratorAdapter<IgniteBiTuple<WALPointer,WALRecord>> implements WALIterator
| Modifier and Type | Field and Description |
|---|---|
protected IgniteBiTuple<WALPointer,WALRecord> |
curRec
Current record preloaded, to be returned on next()
Normally this should be not null because advance() method should already prepare some value |
protected long |
curWalSegmIdx
Current WAL segment absolute index.
|
protected FileIOFactory |
ioFactory
Factory to provide I/O interfaces for read/write operations with files
|
protected IgniteLogger |
log
Logger
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractWalRecordsIterator(IgniteLogger log,
GridCacheSharedContext sharedCtx,
RecordSerializer serializer,
FileIOFactory ioFactory,
int bufSize) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
advance()
Switches records iterator to the next record.
|
protected abstract FileWriteAheadLogManager.ReadFileHandle |
advanceSegment(FileWriteAheadLogManager.ReadFileHandle curWalSegment)
Switches records iterator to the next WAL segment
as result of this method, new reference to segment should be returned.
|
protected FileWriteAheadLogManager.ReadFileHandle |
closeCurrentWalSegment()
Closes and returns WAL segment (if any)
|
protected void |
handleRecordException(Exception e,
FileWALPointer ptr)
Handler for record deserialization exception
|
protected FileWriteAheadLogManager.ReadFileHandle |
initReadHandle(FileWriteAheadLogManager.FileDescriptor desc,
FileWALPointer start) |
protected static FileWriteAheadLogManager.FileDescriptor[] |
loadFileDescriptors(File walFilesDir)
Scans provided folder for a WAL segment files
|
protected boolean |
onHasNext() |
protected IgniteBiTuple<WALPointer,WALRecord> |
onNext() |
checkClosed, close, hasNextX, isClosed, nextX, onClose, onRemove, removeXhasNext, iterator, next, removeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, isClosedhasNextX, nextX, removeXprotected IgniteBiTuple<WALPointer,WALRecord> curRec
protected long curWalSegmIdx
@NotNull protected final IgniteLogger log
@NotNull protected final FileIOFactory ioFactory
protected AbstractWalRecordsIterator(@NotNull
IgniteLogger log,
@NotNull
GridCacheSharedContext sharedCtx,
@NotNull
RecordSerializer serializer,
@NotNull
FileIOFactory ioFactory,
int bufSize)
log - LoggersharedCtx - Shared contextserializer - Serializer of current version to read headers.bufSize - buffer for reading records sizeprotected static FileWriteAheadLogManager.FileDescriptor[] loadFileDescriptors(@NotNull File walFilesDir) throws IgniteCheckedException
walFilesDir - directory to scanIgniteCheckedExceptionprotected IgniteBiTuple<WALPointer,WALRecord> onNext() throws IgniteCheckedException
onNext in class GridCloseableIteratorAdapter<IgniteBiTuple<WALPointer,WALRecord>>IgniteCheckedException - If failed.protected boolean onHasNext()
throws IgniteCheckedException
onHasNext in class GridCloseableIteratorAdapter<IgniteBiTuple<WALPointer,WALRecord>>True if iterator has next element.IgniteCheckedException - If failed.protected void advance()
throws IgniteCheckedException
curRec will be updated.currWalSegment will be updated.advance() runs a step ahead GridIteratorAdapter.next()IgniteCheckedException - If failed.@Nullable protected FileWriteAheadLogManager.ReadFileHandle closeCurrentWalSegment() throws IgniteCheckedException
IgniteCheckedException - if IO failedprotected abstract FileWriteAheadLogManager.ReadFileHandle advanceSegment(@Nullable FileWriteAheadLogManager.ReadFileHandle curWalSegment) throws IgniteCheckedException
curWalSegment - current open WAL segment or null if there is no open segment yetIgniteCheckedException - if reading failedprotected void handleRecordException(@NotNull
Exception e,
@Nullable
FileWALPointer ptr)
e - problem from records readingptr - file pointer was accessedprotected FileWriteAheadLogManager.ReadFileHandle initReadHandle(@NotNull FileWriteAheadLogManager.FileDescriptor desc, @Nullable FileWALPointer start) throws IgniteCheckedException, FileNotFoundException
desc - File descriptor.start - Optional start pointer. Null means read from the beginningFileNotFoundException - If segment file is missing.IgniteCheckedException - If initialized failed due to another unexpected error.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.1.0 Release Date : July 20 2017