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

## Class IgniteWalIteratorFactory

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.persistence.wal.reader.IgniteWalIteratorFactory

    public class IgniteWalIteratorFactory
    extends Object

Factory for creating iterator over WAL files

### Constructor Summary

Constructors
Constructor and Description
`IgniteWalIteratorFactory(IgniteLogger log, FileIOFactory ioFactory, int pageSize)` Creates WAL files iterator factory

### Method Summary

Methods
`WALIterator` `iteratorArchiveDirectory(File walDirWithConsistentId)` Creates iterator for (archive) directory scan mode.
`WALIterator` `iteratorArchiveFiles(File... files)` Creates iterator for file by file scan mode.
`WALIterator` `iteratorWorkFiles(File... files)` Creates iterator for file by file scan mode.

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

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

### Constructor Detail

#### IgniteWalIteratorFactory

    public IgniteWalIteratorFactory(@NotNull
                            IgniteLogger log,
                            @NotNull
                            FileIOFactory ioFactory,
                            int pageSize)

Creates WAL files iterator factory

Parameters:
  `log` - Logger.
  `pageSize` - Page size, size is validated

### Method Detail

#### iteratorArchiveDirectory

    public WALIterator iteratorArchiveDirectory(@NotNull
                                       File walDirWithConsistentId)
                                         throws IgniteCheckedException

Creates iterator for (archive) directory scan mode. Note in this mode total scanned files at end of iteration may be wider that initial files in directory. This mode does not support work directory scan because work directory contains unpredictable number in file name. Such file may broke iteration.

Parameters:
  `walDirWithConsistentId` - directory with WAL files. Should already contain node consistent ID as subfolder
Returns:
  closable WAL records iterator, should be closed when non needed
Throws:
  `IgniteCheckedException` - if failed to read folder

#### iteratorArchiveFiles

    public WALIterator iteratorArchiveFiles(@NotNull
                                   File... files)
                                     throws IgniteCheckedException

Creates iterator for file by file scan mode. This method may be used only for archive folder (not for work). In this mode only provided WAL segments will be scanned. New WAL files created during iteration will be ignored

Parameters:
  `files` - files to scan. Order it not important, but is significant to provide all segments without omissions
Returns:
  closable WAL records iterator, should be closed when non needed
Throws:
  `IgniteCheckedException` - if failed to read files

#### iteratorWorkFiles

    public WALIterator iteratorWorkFiles(@NotNull
                                File... files)
                                  throws IgniteCheckedException

Creates iterator for file by file scan mode. This method may be used for work folder, file indexes are scanned from the file context. In this mode only provided WAL segments will be scanned. New WAL files created during iteration will be ignored.

Parameters:
  `files` - files to scan. Order it not important, but is significant to provide all segments without omissions
Returns:
  closable WAL records iterator, should be closed when non needed
Throws:
  `IgniteCheckedException` - if failed to read files

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.1.0
Release Date | : July 20 2017