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 providedIgniteConfigurationandconsistentId.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPdsFolderResolver.FolderCandidateRepresents parsed new style file and encoded parameters in this file name
-
Field Summary
Fields Modifier and Type Field Description static StringDB_DEFAULT_FOLDERDatabase default folder.static FileFilterDB_SUBFOLDERS_NEW_STYLE_FILTERDatabase subfolders for new style filter.
-
Constructor Summary
Constructors Constructor Description PdsFolderResolver(IgniteConfiguration cfg, IgniteLogger log, @Nullable Serializable consistentId, Function<File,L> tryLock)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PdsFolderSettings<L>generateNew()static @NotNull StringgenNewStyleSubfolderName(int nodeIdx, UUID uuid)Generates DB subfolder name for provided node index (local) and UUID (consistent ID)static @Nullable PdsFolderResolver.FolderCandidateparseSubFolderName(@NotNull File subFolderFile, @NotNull IgniteLogger log)PdsFolderSettings<L>resolve()
-
-
-
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
- 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.
-
-