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

## Class FilePageStoreV2

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.persistence.file.FilePageStore
  - - org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreV2

All Implemented Interfaces:
  Closeable, AutoCloseable, PageStore

    public class FilePageStoreV2
    extends FilePageStore

### Field Summary

Fields
`static int` `VERSION` File version.

### Fields inherited from class org.apache.ignite.internal.processors.cache.persistence.file.FilePageStore

`dbCfg, fileIO, HEADER_SIZE, pageSize`

### Fields inherited from interface org.apache.ignite.internal.pagemem.store.PageStore

`TYPE_DATA, TYPE_IDX`

### Constructor Summary

Constructors
Constructor and Description
`FilePageStoreV2(byte type, IgniteOutClosure<Path> pathProvider, FileIOFactory factory, DataStorageConfiguration cfg, LongConsumer allocatedTracker)` Constructor which initializes file path provider closure, allowing to calculate file path in any time.

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `getBlockSize()`
`long` `getSparseSize()`
`int` `headerSize()` Size of page store header.
`void` `punchHole(long pageId, int usefulBytes)` Should free all the extra storage space after the given number of useful bytes in the given page.
`int` `version()` Page store version.

### Methods inherited from class org.apache.ignite.internal.processors.cache.persistence.file.FilePageStore

`addWriteListener, allocatePage, beginRecover, close, ensure, exists, finishRecover, getFileAbsolutePath, getPageSize, header, init, pageOffset, pages, read, readHeader, removeWriteListener, size, stop, sync, truncate, write`

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

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

### Field Detail

#### VERSION

    public static final int VERSION

File version.

See Also:
  Constant Field Values

### Constructor Detail

#### FilePageStoreV2

    public FilePageStoreV2(byte type,
                           IgniteOutClosure<Path> pathProvider,
                           FileIOFactory factory,
                           DataStorageConfiguration cfg,
                           LongConsumer allocatedTracker)

Constructor which initializes file path provider closure, allowing to calculate file path in any time.

Parameters:
  `type` - Type.
  `pathProvider` - file path provider.
  `factory` - Factory.
  `cfg` - Config.
  `allocatedTracker` - Allocated tracker.

### Method Detail

#### headerSize

    public int headerSize()

Size of page store header.

Overrides:
  `headerSize` in class `FilePageStore`

#### version

    public int version()

Page store version.

Specified by:
  `version` in interface `PageStore`
Overrides:
  `version` in class `FilePageStore`
Returns:
  Page store version.

#### getBlockSize

    public int getBlockSize()

Specified by:
  `getBlockSize` in interface `PageStore`
Overrides:
  `getBlockSize` in class `FilePageStore`
Returns:
  Storage block size or negative value if unknown or not supported.

#### getSparseSize

    public long getSparseSize()

Specified by:
  `getSparseSize` in interface `PageStore`
Overrides:
  `getSparseSize` in class `FilePageStore`
Returns:
  Size of the storage adjusted for sparsity in bytes or negative value if not supported. Should be less than or equal to `PageStore.size()`.
See Also:
  `PageStore.punchHole(long, int)`

#### punchHole

    public void punchHole(long pageId,
                          int usefulBytes)

Should free all the extra storage space after the given number of useful bytes in the given page.

Specified by:
  `punchHole` in interface `PageStore`
Overrides:
  `punchHole` in class `FilePageStore`
Parameters:
  `pageId` - Page id.
  `usefulBytes` - Number of meaningful bytes from the beginning of the page.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.10.0
Release Date | : March 10 2021