use of org.apache.ignite.internal.processors.cache.persistence.wal.io.SegmentIO in project ignite by apache.
the class StandaloneWalRecordsIterator method initReadHandle.
/**
* {@inheritDoc}
*/
@Override
protected AbstractReadFileHandle initReadHandle(@NotNull AbstractFileDescriptor desc, @Nullable WALPointer start) throws IgniteCheckedException, FileNotFoundException {
AbstractFileDescriptor fd = desc;
SegmentIO fileIO = null;
SegmentHeader segmentHeader;
while (true) {
try {
fileIO = fd.toReadOnlyIO(ioFactory);
segmentHeader = readSegmentHeader(fileIO, FILE_INPUT_FACTORY);
break;
} catch (IOException | IgniteCheckedException e) {
log.error("Failed to init segment curWalSegmIdx=" + curWalSegmIdx + ", curIdx=" + curIdx, e);
U.closeQuiet(fileIO);
curIdx++;
if (curIdx >= walFileDescriptors.size())
return null;
fd = walFileDescriptors.get(curIdx);
}
}
return initReadHandle(fd, start, fileIO, segmentHeader);
}
Aggregations