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

## Class PdsFolderSettings

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.persistence.filename.PdsFolderSettings

    public class PdsFolderSettings
    extends Object

Class holds information required for folder generation for ignite persistent store

### Constructor Summary

Constructors
Constructor and Description
`PdsFolderSettings(@Nullable File persistentStoreRootPath, @NotNull Serializable consistentId)` Creates settings for compatible mode.
`PdsFolderSettings(@Nullable File persistentStoreRootPath, String folderName, Serializable consistentId, GridCacheDatabaseSharedManager.FileLockHolder fileLockHolder, boolean compatible)` Creates settings in for new PST(DB) folder mode.

### Method Summary

All Methods Instance Methods Concrete Methods
`Serializable` `consistentId()`
`String` `folderName()`
`GridCacheDatabaseSharedManager.FileLockHolder` `getLockedFileLockHolder()` Returns already locked file lock holder to lock file in `persistentStoreRootPath`.
`boolean` `isCompatible()`
`File` `persistentStoreNodePath()`
`@Nullable File` `persistentStoreRootPath()`
`String` `toString()`

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

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

### Constructor Detail

#### PdsFolderSettings

    public PdsFolderSettings(@Nullable
                             @Nullable File persistentStoreRootPath,
                             String folderName,
                             Serializable consistentId,
                             @Nullable
                             GridCacheDatabaseSharedManager.FileLockHolder fileLockHolder,
                             boolean compatible)

Creates settings in for new PST(DB) folder mode.

Parameters:
  `persistentStoreRootPath` - Persistent store root path or null if non PDS mode.
  `folderName` - Sub folder name containing consistent ID and optionally node index.
  `consistentId` - Consistent id.
  `fileLockHolder` - File lock holder with prelocked db directory.
  `compatible` - Compatible mode flag.

#### PdsFolderSettings

    public PdsFolderSettings(@Nullable
                             @Nullable File persistentStoreRootPath,
                             @NotNull
                             @NotNull Serializable consistentId)

Creates settings for compatible mode. Folder name is consistent ID (masked), no node prefix is added.

Parameters:
  `persistentStoreRootPath` - root DB path.
  `consistentId` - node consistent ID.

### Method Detail

#### folderName

    public String folderName()

Returns:
  sub folders name based on consistent ID. In compatible mode this is escaped consistent ID, in new mode this is UUID based folder name.

#### consistentId

    public Serializable consistentId()

Returns:
  Consistent id to be set to local node.

#### isCompatible

    public boolean isCompatible()

Returns:
  flag indicating if compatible mode is enabled for folder generation. In that case all sub folders names are generated from consistent ID without 'node' and node index prefix. In compatible mode there is no overriding for consistent ID is done for cluster node. Locking files is independent to compatibility mode.

#### getLockedFileLockHolder

    @Nullable
    public GridCacheDatabaseSharedManager.FileLockHolder getLockedFileLockHolder()

Returns already locked file lock holder to lock file in `persistentStoreRootPath`. Unlock and close this lock is not required.

Returns:
  File lock holder with prelocked db directory.

#### persistentStoreRootPath

    @Nullable
    public @Nullable File persistentStoreRootPath()

Returns:
  DB storage absolute root path resolved as 'db' folder in Ignite work dir (by default) or using persistent store configuration. Note WAL storage may be configured outside this path. May return null for non pds mode.

#### persistentStoreNodePath

    public File persistentStoreNodePath()

Returns:
  Storage directory for node.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

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