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

## Class PdsConsistentIdProcessor

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

All Implemented Interfaces:
  GridComponent, PdsFoldersResolver, GridProcessor

    public class PdsConsistentIdProcessor
    extends GridProcessorAdapter
    implements PdsFoldersResolver

Component for resolving PDS storage file names, also used for generating consistent ID for case PDS mode is enabled

### Nested Class Summary

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

### Nested classes/interfaces inherited from interface org.apache.ignite.internal.GridComponent

`GridComponent.DiscoveryDataExchangeType`

### Field Summary

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

### Fields inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter

`diagnosticLog`

### Constructor Summary

Constructors
Constructor and Description
`PdsConsistentIdProcessor(GridKernalContext ctx)` Creates folders resolver

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static String` `genNewStyleSubfolderName(int nodeIdx, UUID uuid)` Generates DB subfolder name for provided node index (local) and UUID (consistent ID)
`static PdsConsistentIdProcessor.FolderCandidate` `parseSubFolderName(File subFolderFile, IgniteLogger log)`
`PdsFolderSettings` `resolveFolders()` Prepares and caches PDS folder settings.
`void` `stop(boolean cancel)` Stops grid component.

### Methods inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter

`assertParameter, collectGridNodeData, collectJoiningNodeData, discoveryDataType, onDisconnected, onGridDataReceived, onJoiningNodeDataReceived, onKernalStart, onKernalStop, onReconnected, printMemoryStats, start, toString, validateNode, validateNode`

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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

#### PdsConsistentIdProcessor

    public PdsConsistentIdProcessor(GridKernalContext ctx)

Creates folders resolver

Parameters:
  `ctx` - Context.

### Method Detail

#### resolveFolders

    public PdsFolderSettings resolveFolders()
                                     throws IgniteCheckedException

Prepares and caches PDS folder settings. Subsequent call to this method will provide same settings.

Specified by:
  `resolveFolders` in interface `PdsFoldersResolver`
Returns:
  PDS folder settings, consistentID and prelocked DB file lock.
Throws:
  `IgniteCheckedException` - if failed.

#### genNewStyleSubfolderName

    @NotNull
    public static 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 PdsConsistentIdProcessor.FolderCandidate parseSubFolderName(@NotNull
                                                                                        File subFolderFile,
                                                                                        @NotNull
                                                                                        IgniteLogger log)

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

#### stop

    public void stop(boolean cancel)
              throws IgniteCheckedException

Stops grid component.

Specified by:
  `stop` in interface `GridComponent`
Overrides:
  `stop` in class `GridProcessorAdapter`
Parameters:
  `cancel` - If `true`, then all ongoing tasks or jobs for relevant components need to be cancelled.
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.6.0
Release Date | : July 10 2018