org.apache.ignite.internal.processors.igfs

## Class IgfsMetaManager

- java.lang.Object
- - org.apache.ignite.internal.processors.igfs.IgfsManager
  - - org.apache.ignite.internal.processors.igfs.IgfsMetaManager

    public class IgfsMetaManager
    extends IgfsManager

Cache based structure (meta data) manager.

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.igfs.IgfsManager

`igfsCtx`

### Constructor Summary

Constructors
Constructor and Description
`IgfsMetaManager(boolean relaxed, boolean client)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`IgfsCreateResult` `appendDual(IgfsSecondaryFileSystem fs, IgfsPath path, int bufSize, boolean create)` Append to a file in DUAL mode.
`Map<String,IgfsListingEntry>` `directoryListing(IgniteUuid fileId)` List child files for specified file ID.
`boolean` `exists(IgniteUuid fileId)` Ensure that entry with the given ID exists in meta cache.
`IgfsEntryInfo` `fileForFragmentizer(Collection<IgniteUuid> exclude)` Gets first available file info for fragmentizer.
`IgniteUuid` `fileId(IgfsPath path)` Gets file ID for specified path.
`IgniteUuid` `fileId(IgniteUuid parentId, String fileName)` Gets file ID by its name from parent directory listing.
`List<IgniteUuid>` `fileIds(IgfsPath path)` Gets all file IDs for components of specified path.
`List<IgniteUuid>` `idsForPath(IgfsPath path)` Get IDs for the given path.
`IgfsEntryInfo` `info(IgniteUuid fileId)` Gets file info by its ID.
`IgfsEntryInfo` `infoForPath(IgfsPath path)` Get info for the given path.
`Map<IgniteUuid,IgfsEntryInfo>` `infos(Collection<IgniteUuid> fileIds)` Gets files details by their IDs.
`IgfsEntryInfo` `lock(IgniteUuid fileId, boolean del)` Lock the file explicitly outside of transaction.
`boolean` `mkdirsDual(IgfsSecondaryFileSystem fs, IgfsPath path, Map<String,String> props)` Create directory in DUAL mode.
`void` `move(IgfsPath srcPath, IgfsPath dstPath)` Move routine.
`protected void` `onKernalStart0()`
`protected void` `onKernalStop0(boolean cancel)`
`IgfsSecondaryInputStreamDescriptor` `openDual(IgfsSecondaryFileSystem fs, IgfsPath path, int bufSize)` Open file in DUAL mode.
`IgfsPathIds` `pathIds(IgfsPath path)` Gets all file IDs for components of specified path.
`boolean` `renameDual(IgfsSecondaryFileSystem fs, IgfsPath src, IgfsPath dest)` Rename path in DUAL mode.
`IgfsEntryInfo` `reserveSpace(IgniteUuid fileId, long space, IgfsFileAffinityRange affRange)` Reserve space for file.
`Boolean` `sampling()` Get sampling flag state.
`boolean` `sampling(Boolean val)` Set sampling flag.
`protected void` `start0()` Start manager implementation.
`IgfsEntryInfo` `synchronizeFileDual(IgfsSecondaryFileSystem fs, IgfsPath path)` Synchronizes with secondary file system.
`void` `unlock(IgniteUuid fileId, IgniteUuid lockId, long modificationTime)` Remove explicit lock on file held by the current stream.
`void` `unlock(IgniteUuid fileId, IgniteUuid lockId, long modificationTime, boolean updateSpace, long space, IgfsFileAffinityRange affRange)` Remove explicit lock on file held by the current stream.
`IgfsEntryInfo` `updateDual(IgfsSecondaryFileSystem fs, IgfsPath path, Map<String,String> props)` Update path in DUAL mode.
`IgfsEntryInfo` `updateInfo(IgniteUuid fileId, javax.cache.processor.EntryProcessor<IgniteUuid,IgfsEntryInfo,IgfsEntryInfo> proc)` Update file info in cache.
`IgfsEntryInfo` `updateProperties(IgniteUuid fileId, Map<String,String> props)` Update file info (file properties) in cache.
`void` `updateTimes(IgfsPath path, long modificationTime, long accessTime, IgfsSecondaryFileSystem secondaryFs)` Update times.

### Methods inherited from class org.apache.ignite.internal.processors.igfs.IgfsManager

`kernalStartInfo, kernalStopInfo, onKernalStart, onKernalStop, start, startInfo, stop, stop0, stopInfo`

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

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

### Constructor Detail

#### IgfsMetaManager

    public IgfsMetaManager(boolean relaxed,
                           boolean client)

Constructor.

Parameters:
  `relaxed` - Relaxed mode flag.
  `client` - Client flag.

### Method Detail

#### start0

    protected void start0()
                   throws IgniteCheckedException

Start manager implementation.

Overrides:
  `start0` in class `IgfsManager`
Throws:
  `IgniteCheckedException`

#### onKernalStart0

    protected void onKernalStart0()
                           throws IgniteCheckedException

Overrides:
  `onKernalStart0` in class `IgfsManager`
Throws:
  `IgniteCheckedException` - If failed.

#### onKernalStop0

    protected void onKernalStop0(boolean cancel)

Overrides:
  `onKernalStop0` in class `IgfsManager`

#### fileId

    @Nullable
    public IgniteUuid fileId(IgfsPath path)
                                throws IgniteCheckedException

Gets file ID for specified path.

Parameters:
  `path` - Path.
Returns:
  File ID for specified path or `null` if such file doesn't exist.
Throws:
  `IgniteCheckedException` - If failed.

#### fileId

    @Nullable
    public IgniteUuid fileId(IgniteUuid parentId,
                                       String fileName)
                                throws IgniteCheckedException

Gets file ID by its name from parent directory listing.

Parameters:
  `parentId` - Parent directory ID to get child ID for.
  `fileName` - File name in parent listing to get file ID for.
Returns:
  File ID.
Throws:
  `IgniteCheckedException` - If failed.

#### fileIds

    public List<IgniteUuid> fileIds(IgfsPath path)
                             throws IgniteCheckedException

Gets all file IDs for components of specified path. Result cannot be empty - there is at least root element. But each element (except the first) can be `null` if such files don't exist.

Parameters:
  `path` - Path.
Returns:
  Collection of file IDs for components of specified path.
Throws:
  `IgniteCheckedException` - If failed.

#### pathIds

    public IgfsPathIds pathIds(IgfsPath path)
                        throws IgniteCheckedException

Gets all file IDs for components of specified path. Result cannot be empty - there is at least root element. But each element (except the first) can be `null` if such files don't exist.

Parameters:
  `path` - Path.
Returns:
  Collection of file IDs for components of specified path.
Throws:
  `IgniteCheckedException` - If failed.

#### exists

    public boolean exists(IgniteUuid fileId)
                   throws IgniteCheckedException

Ensure that entry with the given ID exists in meta cache.

Parameters:
  `fileId` - File id.
Returns:
  `True` in case such entry exists.
Throws:
  `IgniteCheckedException` - IF failed.

#### info

    @Nullable
    public IgfsEntryInfo info(@Nullable
                                        IgniteUuid fileId)
                                 throws IgniteCheckedException

Gets file info by its ID. NB: this method is used both in Tx and out of Tx.

Parameters:
  `fileId` - File ID to get details for.
Returns:
  File info.
Throws:
  `IgniteCheckedException` - If failed.

#### infos

    public Map<IgniteUuid,IgfsEntryInfo> infos(Collection<IgniteUuid> fileIds)
                                        throws IgniteCheckedException

Gets files details by their IDs.

Parameters:
  `fileIds` - file IDs to get details for.
Returns:
  Files details.
Throws:
  `IgniteCheckedException` - If failed.

#### lock

    @Nullable
    public IgfsEntryInfo lock(IgniteUuid fileId,
                                        boolean del)
                                 throws IgniteCheckedException

Lock the file explicitly outside of transaction.

Parameters:
  `fileId` - File ID to lock.
  `del` - If file is being locked for delete.
Returns:
  Locked file info or `null` if file cannot be locked or doesn't exist.
Throws:
  `IgniteCheckedException` - If the file with such id does not exist, or on another failure.

#### unlock

    public void unlock(IgniteUuid fileId,
                       IgniteUuid lockId,
                       long modificationTime)
                throws IgniteCheckedException

Remove explicit lock on file held by the current stream.

Parameters:
  `fileId` - File ID.
  `lockId` - Lock ID.
  `modificationTime` - Modification time to write to file info.
Throws:
  `IgniteCheckedException` - If failed.

#### unlock

    public void unlock(IgniteUuid fileId,
                       IgniteUuid lockId,
                       long modificationTime,
                       boolean updateSpace,
                       long space,
                       @Nullable
                       IgfsFileAffinityRange affRange)
                throws IgniteCheckedException

Remove explicit lock on file held by the current stream.

Parameters:
  `fileId` - File ID.
  `lockId` - Lock ID.
  `modificationTime` - Modification time to write to file info.
  `updateSpace` - Whether to update space.
  `space` - Space.
  `affRange` - Affinity range.
Throws:
  `IgniteCheckedException` - If failed.

#### directoryListing

    public Map<String,IgfsListingEntry> directoryListing(IgniteUuid fileId)
                                                  throws IgniteCheckedException

List child files for specified file ID.

Parameters:
  `fileId` - File to list child files for.
Returns:
  Directory listing for the specified file.
Throws:
  `IgniteCheckedException` - If failed.

#### fileForFragmentizer

    public IgfsEntryInfo fileForFragmentizer(Collection<IgniteUuid> exclude)
                                      throws IgniteCheckedException

Gets first available file info for fragmentizer.

Parameters:
  `exclude` - File IDs to exclude from result.
Returns:
  First qualified file info.
Throws:
  `IgniteCheckedException` - If failed to get file for fragmentizer.

#### move

    public void move(IgfsPath srcPath,
                     IgfsPath dstPath)
              throws IgniteCheckedException

Move routine.

Parameters:
  `srcPath` - Source path.
  `dstPath` - Destination path.
Throws:
  `IgniteCheckedException` - In case of exception.

#### updateProperties

    @Nullable
    public IgfsEntryInfo updateProperties(IgniteUuid fileId,
                                                    Map<String,String> props)
                                             throws IgniteCheckedException

Update file info (file properties) in cache.

Parameters:
  `fileId` - File ID to update information for.
  `props` - Properties to set for the file.
Returns:
  Updated file info or `null` if such file ID not found.
Throws:
  `IgniteCheckedException` - If operation failed.

#### reserveSpace

    public IgfsEntryInfo reserveSpace(IgniteUuid fileId,
                                      long space,
                                      IgfsFileAffinityRange affRange)
                               throws IgniteCheckedException

Reserve space for file.

Parameters:
  `fileId` - File ID.
  `space` - Space.
  `affRange` - Affinity range.
Returns:
  New file info.
Throws:
  `IgniteCheckedException`

#### updateInfo

    @Nullable
    public IgfsEntryInfo updateInfo(IgniteUuid fileId,
                                              javax.cache.processor.EntryProcessor<IgniteUuid,IgfsEntryInfo,IgfsEntryInfo> proc)
                                       throws IgniteCheckedException

Update file info in cache.

Parameters:
  `fileId` - File ID to update information for.
  `proc` - Entry processor to invoke.
Returns:
  Updated file info or `null` if such file ID not found.
Throws:
  `IgniteCheckedException` - If failed.

#### sampling

    public boolean sampling(Boolean val)
                     throws IgniteCheckedException

Set sampling flag.

Parameters:
  `val` - Sampling flag state or `null` to clear sampling state and mark it as "not set".
Returns:
  `True` if sampling mode was actually changed by this call.
Throws:
  `IgniteCheckedException` - If failed.

#### sampling

    public Boolean sampling()
                     throws IgniteCheckedException

Get sampling flag state.

Returns:
  `True` in case sampling is enabled, `false` otherwise or `null` in case sampling is not set.
Throws:
  `IgniteCheckedException` - If failed.

#### appendDual

    public IgfsCreateResult appendDual(IgfsSecondaryFileSystem fs,
                                       IgfsPath path,
                                       int bufSize,
                                       boolean create)
                                throws IgniteCheckedException

Append to a file in DUAL mode.

Parameters:
  `fs` - File system.
  `path` - Path.
  `bufSize` - Buffer size.
  `create` - Create flag.
Returns:
  Output stream descriptor.
Throws:
  `IgniteCheckedException` - If output stream open for append has failed.

#### infoForPath

    @Nullable
    public IgfsEntryInfo infoForPath(IgfsPath path)
                                        throws IgniteCheckedException

Get info for the given path.

Parameters:
  `path` - Path.
Returns:
  Info.
Throws:
  `IgniteCheckedException` - If failed.

#### idsForPath

    public List<IgniteUuid> idsForPath(IgfsPath path)
                                throws IgniteCheckedException

Get IDs for the given path.

Parameters:
  `path` - Path.
Returns:
  IDs.
Throws:
  `IgniteCheckedException` - If failed.

#### openDual

    public IgfsSecondaryInputStreamDescriptor openDual(IgfsSecondaryFileSystem fs,
                                                       IgfsPath path,
                                                       int bufSize)
                                                throws IgniteCheckedException

Open file in DUAL mode.

Parameters:
  `fs` - Secondary file system.
  `path` - Path to open.
  `bufSize` - Buffer size.
Returns:
  Input stream descriptor.
Throws:
  `IgniteCheckedException` - If input stream open has failed.

#### synchronizeFileDual

    @Nullable
    public IgfsEntryInfo synchronizeFileDual(IgfsSecondaryFileSystem fs,
                                                       IgfsPath path)
                                                throws IgniteCheckedException

Synchronizes with secondary file system.

Parameters:
  `fs` - File system.
  `path` - Path.
Returns:
  File info or `null` if file not found.
Throws:
  `IgniteCheckedException` - If sync task failed.

#### mkdirsDual

    public boolean mkdirsDual(IgfsSecondaryFileSystem fs,
                              IgfsPath path,
                              Map<String,String> props)
                       throws IgniteCheckedException

Create directory in DUAL mode.

Parameters:
  `fs` - Secondary file system.
  `path` - Path to create.
  `props` - Properties to be applied.
Returns:
  `True` in case rename was successful.
Throws:
  `IgniteCheckedException` - If directory creation failed.

#### renameDual

    public boolean renameDual(IgfsSecondaryFileSystem fs,
                              IgfsPath src,
                              IgfsPath dest)
                       throws IgniteCheckedException

Rename path in DUAL mode.

Parameters:
  `fs` - Secondary file system.
  `src` - Source path.
  `dest` - Destination path.
Returns:
  Operation result.
Throws:
  `IgniteCheckedException` - If failed.

#### updateDual

    public IgfsEntryInfo updateDual(IgfsSecondaryFileSystem fs,
                                    IgfsPath path,
                                    Map<String,String> props)
                             throws IgniteCheckedException

Update path in DUAL mode.

Parameters:
  `fs` - Secondary file system.
  `path` - Path to update.
  `props` - Properties to be applied.
Returns:
  Update file info.
Throws:
  `IgniteCheckedException` - If update failed.

#### updateTimes

    public void updateTimes(IgfsPath path,
                            long modificationTime,
                            long accessTime,
                            IgfsSecondaryFileSystem secondaryFs)
                     throws IgniteCheckedException

Update times.

Parameters:
  `path` - Path.
  `accessTime` - Access time.
  `modificationTime` - Modification time.
  `secondaryFs` - Secondary file system.
Throws:
  `IgniteCheckedException` - If failed.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.6
Release Date | : September 11 2019