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

## Class PdsFolderResolver<L extends FileLockHolder>

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.persistence.filename.PdsFolderResolver<L>

Type Parameters:
  `L` - Type of the lock holder.

    public class PdsFolderResolver<L extends FileLockHolder>
    extends Object

This class contains logic to resolve and possibly lock PDS folder based on provided `IgniteConfiguration` and `consistentId`.

### Nested Class Summary

Nested Classes
`static class` `PdsFolderResolver.FolderCandidate` Represents parsed new style file and encoded parameters in this file name

### Field Summary

Fields
`static String` `DB_DEFAULT_FOLDER` Database default folder.
`static FileFilter` `DB_SUBFOLDERS_NEW_STYLE_FILTER` Database subfolders for new style filter.

### Constructor Summary

Constructors
Constructor and Description
`PdsFolderResolver(IgniteConfiguration cfg, IgniteLogger log, @Nullable Serializable consistentId, Function<File,L> tryLock)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`PdsFolderSettings<L>` `generateNew()`
`static @NotNull String` `genNewStyleSubfolderName(int nodeIdx, UUID uuid)` Generates DB subfolder name for provided node index (local) and UUID (consistent ID)
`static @Nullable PdsFolderResolver.FolderCandidate` `parseSubFolderName(@NotNull File subFolderFile, @NotNull IgniteLogger log)`
`PdsFolderSettings<L>` `resolve()` Resolves `PdsFolderSettings` according to specified `IgniteConfiguration`, `consistentId`.

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

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

### Field Detail

#### DB_SUBFOLDERS_NEW_STYLE_FILTER

    public static final FileFilter DB_SUBFOLDERS_NEW_STYLE_FILTER

Database subfolders for new style filter.

#### DB_DEFAULT_FOLDER

    public static final String DB_DEFAULT_FOLDER

Database default folder.

See Also:
  Constant Field Values

### Constructor Detail

#### PdsFolderResolver

    public PdsFolderResolver(IgniteConfiguration cfg,
                             IgniteLogger log,
                             @Nullable
                             @Nullable Serializable consistentId,
                             Function<File,L> tryLock)

Parameters:
  `cfg` - Ignite configuration.
  `log` - Logger.
  `consistentId` - Constent id.
  `tryLock` - Lock function.

### Method Detail

#### resolve

    public PdsFolderSettings<L> resolve()
                                 throws IgniteCheckedException

Resolves `PdsFolderSettings` according to specified `IgniteConfiguration`, `consistentId`.

Returns:
  new settings with prelocked directory (if appropriate) or null.
Throws:
  `IgniteCheckedException` - if IO failed.

#### generateNew

    public PdsFolderSettings<L> generateNew()
                                     throws IgniteCheckedException

Returns:
  New PDS folder.
Throws:
  `IgniteCheckedException` - In case of error.

#### genNewStyleSubfolderName

    @NotNull
    public static @NotNull String genNewStyleSubfolderName(int nodeIdx,
                                                                    UUID uuid)

Generates DB subfolder name for provided node index (local) and UUID (consistent ID)

Parameters:
  `nodeIdx` - node index.
  `uuid` - consistent ID.
Returns:
  folder file name

#### parseSubFolderName

    @Nullable
    public static @Nullable PdsFolderResolver.FolderCandidate parseSubFolderName(@NotNull
                                                                                           @NotNull File subFolderFile,
                                                                                           @NotNull
                                                                                           @NotNull IgniteLogger log)

Parameters:
  `subFolderFile` - new style file to parse.
  `log` - Logger.
Returns:
  Pair of UUID and node index.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022