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

## Class SegmentRouter

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

    public class SegmentRouter
    extends Object

Class for manage of segment file location.

### Field Summary

Fields
`static String` `ZIP_SUFFIX`

### Constructor Summary

Constructors
Constructor and Description
`SegmentRouter(File walWorkDir, File walArchiveDir, SegmentAware segmentAware, DataStorageConfiguration dsCfg)`

### Method Summary

All Methods Instance Methods Concrete Methods
`FileDescriptor` `findSegment(long segmentId)` Find file which represent given segment.
`File` `getWalArchiveDir()`
`File` `getWalWorkDir()`
`boolean` `hasArchive()`

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

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

### Field Detail

#### ZIP_SUFFIX

    public static final String ZIP_SUFFIX

See Also:
  Constant Field Values

### Constructor Detail

#### SegmentRouter

    public SegmentRouter(File walWorkDir,
                         File walArchiveDir,
                         SegmentAware segmentAware,
                         DataStorageConfiguration dsCfg)

Parameters:
  `walWorkDir` - WAL work directory.
  `walArchiveDir` - WAL archive directory.
  `segmentAware` - Holder of actual information of latest manipulation on WAL segments.
  `dsCfg` - Data storage configuration.

### Method Detail

#### findSegment

    public FileDescriptor findSegment(long segmentId)
                               throws FileNotFoundException

Find file which represent given segment.

Parameters:
  `segmentId` - Segment for searching.
Returns:
  Actual file description.
Throws:
  `FileNotFoundException` - If file does not exist.

#### hasArchive

    public boolean hasArchive()

Returns:
  `true` If archive folder exists.

#### getWalWorkDir

    public File getWalWorkDir()

Returns:
  WAL working directory.

#### getWalArchiveDir

    public File getWalArchiveDir()

Returns:
  WAL archive directory.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.11.1
Release Date | : December 20 2021