public class IgfsAsyncImpl extends AsyncSupportAdapter<IgniteFileSystem> implements IgfsEx
curFutIGFS_SCHEME| Constructor and Description |
|---|
IgfsAsyncImpl(IgfsImpl igfs) |
| Modifier and Type | Method and Description |
|---|---|
Collection<IgfsBlockLocation> |
affinity(IgfsPath path,
long start,
long len)
Gets affinity block locations for data blocks of the file, i.e. the nodes, on which the blocks
are stored.
|
Collection<IgfsBlockLocation> |
affinity(IgfsPath path,
long start,
long len,
long maxLen)
Get affinity block locations for data blocks of the file.
|
IgfsOutputStream |
append(IgfsPath path,
boolean create)
Opens an output stream to an existing file for appending data.
|
IgfsOutputStream |
append(IgfsPath path,
int bufSize,
boolean create,
Map<String,String> props)
Opens an output stream to an existing file for appending data.
|
IgfsSecondaryFileSystem |
asSecondary()
Return the given IGFS as a secondary file system.
|
void |
await(IgfsPath... paths)
Await for any pending finished writes on the children paths.
|
void |
clear()
Formats the file system removing all existing entries from it, but not removing anything in secondary
file system (if any).
|
IgniteFuture<Void> |
clearAsync()
Formats the file system removing all existing entries from it, but not removing anything in secondary
file system (if any).
|
String |
clientLogDirectory()
Gets client file system log directory.
|
void |
clientLogDirectory(String logDir)
Sets client file system log directory.
|
FileSystemConfiguration |
configuration()
Gets IGFS configuration.
|
IgfsContext |
context() |
IgfsOutputStream |
create(IgfsPath path,
boolean overwrite)
Creates a file and opens it for writing.
|
IgfsOutputStream |
create(IgfsPath path,
int bufSize,
boolean overwrite,
IgniteUuid affKey,
int replication,
long blockSize,
Map<String,String> props)
Creates a file and opens it for writing.
|
IgfsOutputStream |
create(IgfsPath path,
int bufSize,
boolean overwrite,
int replication,
long blockSize,
Map<String,String> props)
Creates a file and opens it for writing.
|
boolean |
delete(IgfsPath path,
boolean recursive)
Deletes file.
|
boolean |
evictExclude(IgfsPath path,
boolean primary)
Whether this path is excluded from evictions.
|
<T,R> R |
execute(Class<? extends IgfsTask<T,R>> taskCls,
IgfsRecordResolver rslvr,
Collection<IgfsPath> paths,
boolean skipNonExistentFiles,
long maxRangeLen,
T arg)
Executes IGFS task with overridden maximum range length (see
FileSystemConfiguration.getMaximumTaskRangeLength() for more information). |
<T,R> R |
execute(Class<? extends IgfsTask<T,R>> taskCls,
IgfsRecordResolver rslvr,
Collection<IgfsPath> paths,
T arg)
Executes IGFS task.
|
<T,R> R |
execute(IgfsTask<T,R> task,
IgfsRecordResolver rslvr,
Collection<IgfsPath> paths,
boolean skipNonExistentFiles,
long maxRangeLen,
T arg)
Executes IGFS task with overridden maximum range length (see
FileSystemConfiguration.getMaximumTaskRangeLength() for more information). |
<T,R> R |
execute(IgfsTask<T,R> task,
IgfsRecordResolver rslvr,
Collection<IgfsPath> paths,
T arg)
Executes IGFS task.
|
<T,R> IgniteFuture<R> |
executeAsync(Class<? extends IgfsTask<T,R>> taskCls,
IgfsRecordResolver rslvr,
Collection<IgfsPath> paths,
boolean skipNonExistentFiles,
long maxRangeLen,
T arg)
Executes IGFS task asynchronously with overridden maximum range length (see
FileSystemConfiguration.getMaximumTaskRangeLength() for more information). |
<T,R> IgniteFuture<R> |
executeAsync(Class<? extends IgfsTask<T,R>> taskCls,
IgfsRecordResolver rslvr,
Collection<IgfsPath> paths,
T arg)
Executes IGFS task asynchronously.
|
<T,R> IgniteFuture<R> |
executeAsync(IgfsTask<T,R> task,
IgfsRecordResolver rslvr,
Collection<IgfsPath> paths,
boolean skipNonExistentFiles,
long maxRangeLen,
T arg)
Executes IGFS task asynchronously with overridden maximum range length (see
FileSystemConfiguration.getMaximumTaskRangeLength() for more information). |
<T,R> IgniteFuture<R> |
executeAsync(IgfsTask<T,R> task,
IgfsRecordResolver rslvr,
Collection<IgfsPath> paths,
T arg)
Executes IGFS task asynchronously.
|
boolean |
exists(IgfsPath path)
Checks if the specified path exists in the file system.
|
Boolean |
globalSampling()
Get sampling state.
|
void |
globalSampling(Boolean val)
Enables, disables or clears sampling flag.
|
IgfsStatus |
globalSpace()
Gets global space counters.
|
long |
groupBlockSize()
Gets group block size, i.e. block size multiplied by group size in affinity mapper.
|
IgfsFile |
info(IgfsPath path)
Gets file information for the specified path.
|
boolean |
isProxy(URI path)
Check whether the given path is proxy path.
|
Collection<IgfsFile> |
listFiles(IgfsPath path)
Lists files under the specified path.
|
Collection<IgfsPath> |
listPaths(IgfsPath path)
Lists file paths under the specified path.
|
IgfsMetrics |
metrics()
Gets metrics snapshot for this file system.
|
void |
mkdirs(IgfsPath path)
Creates directories under specified path.
|
void |
mkdirs(IgfsPath path,
Map<String,String> props)
Creates directories under specified path with the specified properties.
|
IgfsMode |
mode(IgfsPath path)
Get mode for the given path.
|
String |
name()
Gets IGFS name.
|
IgniteUuid |
nextAffinityKey()
Get next affinity key.
|
IgfsInputStream |
open(IgfsPath path)
Opens a file for reading.
|
IgfsInputStream |
open(IgfsPath path,
int bufSize)
Opens a file for reading.
|
IgfsInputStream |
open(IgfsPath path,
int bufSize,
int seqReadsBeforePrefetch)
Opens a file for reading.
|
void |
rename(IgfsPath src,
IgfsPath dest)
Renames/moves a file.
|
void |
resetMetrics()
Resets metrics for this file system.
|
void |
setTimes(IgfsPath path,
long modificationTime,
long accessTime)
Sets last access time and last modification time for a given path.
|
long |
size(IgfsPath path)
Determines size of the file denoted by provided path.
|
void |
stop(boolean cancel)
Stops IGFS cleaning all used resources.
|
IgfsPathSummary |
summary(IgfsPath path)
Gets summary (total number of files, total number of directories and total length)
for a given path.
|
IgfsFile |
update(IgfsPath path,
Map<String,String> props)
Updates file information for the specified path.
|
long |
usedSpaceSize()
Gets used space in bytes.
|
createAsyncInstance, createFuture, future, future, isAsync, saveOrGet, withAsyncclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwithAsyncfuture, isAsyncpublic IgfsAsyncImpl(IgfsImpl igfs)
igfs - Igfs.public void clear()
clear in interface IgniteFileSystempublic IgniteFuture<Void> clearAsync() throws IgniteException
clearAsync in interface IgniteFileSystemIgniteExceptionpublic <T,R> R execute(IgfsTask<T,R> task, @Nullable IgfsRecordResolver rslvr, Collection<IgfsPath> paths, @Nullable T arg)
execute in interface IgniteFileSystemtask - Task to execute.rslvr - Optional resolver to control split boundaries.paths - Collection of paths to be processed within this task.arg - Optional task argument.public <T,R> IgniteFuture<R> executeAsync(IgfsTask<T,R> task, @Nullable IgfsRecordResolver rslvr, Collection<IgfsPath> paths, @Nullable T arg) throws IgniteException
executeAsync in interface IgniteFileSystemtask - Task to execute.rslvr - Optional resolver to control split boundaries.paths - Collection of paths to be processed within this task.arg - Optional task argument.IgniteException - If execution failed.public <T,R> R execute(IgfsTask<T,R> task, @Nullable IgfsRecordResolver rslvr, Collection<IgfsPath> paths, boolean skipNonExistentFiles, long maxRangeLen, @Nullable T arg)
FileSystemConfiguration.getMaximumTaskRangeLength() for more information).
Supports asynchronous execution (see IgniteAsyncSupport).
execute in interface IgniteFileSystemtask - Task to execute.rslvr - Optional resolver to control split boundaries.paths - Collection of paths to be processed within this task.skipNonExistentFiles - Whether to skip non existent files. If set to true non-existent files will
be ignored. Otherwise an exception will be thrown.maxRangeLen - Optional maximum range length. If 0, then by default all consecutive
IGFS blocks will be included.arg - Optional task argument.public <T,R> IgniteFuture<R> executeAsync(IgfsTask<T,R> task, @Nullable IgfsRecordResolver rslvr, Collection<IgfsPath> paths, boolean skipNonExistentFiles, long maxRangeLen, @Nullable T arg) throws IgniteException
FileSystemConfiguration.getMaximumTaskRangeLength() for more information).executeAsync in interface IgniteFileSystemtask - Task to execute.rslvr - Optional resolver to control split boundaries.paths - Collection of paths to be processed within this task.skipNonExistentFiles - Whether to skip non existent files. If set to true non-existent files will
be ignored. Otherwise an exception will be thrown.maxRangeLen - Optional maximum range length. If 0, then by default all consecutive
IGFS blocks will be included.arg - Optional task argument.IgniteException - If execution failed.public <T,R> R execute(Class<? extends IgfsTask<T,R>> taskCls, @Nullable IgfsRecordResolver rslvr, Collection<IgfsPath> paths, @Nullable T arg)
Supports asynchronous execution (see IgniteAsyncSupport).
execute in interface IgniteFileSystemtaskCls - Task class to execute.rslvr - Optional resolver to control split boundaries.paths - Collection of paths to be processed within this task.arg - Optional task argument.public <T,R> IgniteFuture<R> executeAsync(Class<? extends IgfsTask<T,R>> taskCls, @Nullable IgfsRecordResolver rslvr, Collection<IgfsPath> paths, @Nullable T arg) throws IgniteException
executeAsync in interface IgniteFileSystemtaskCls - Task class to execute.rslvr - Optional resolver to control split boundaries.paths - Collection of paths to be processed within this task.arg - Optional task argument.IgniteException - If execution failed.public <T,R> R execute(Class<? extends IgfsTask<T,R>> taskCls, @Nullable IgfsRecordResolver rslvr, Collection<IgfsPath> paths, boolean skipNonExistentFiles, long maxRangeLen, @Nullable T arg)
FileSystemConfiguration.getMaximumTaskRangeLength() for more information).
Supports asynchronous execution (see IgniteAsyncSupport).
execute in interface IgniteFileSystemtaskCls - Task class to execute.rslvr - Optional resolver to control split boundaries.paths - Collection of paths to be processed within this task.skipNonExistentFiles - Whether to skip non existent files. If set to true non-existent files will
be ignored. Otherwise an exception will be thrown.maxRangeLen - Maximum range length.arg - Optional task argument.public <T,R> IgniteFuture<R> executeAsync(Class<? extends IgfsTask<T,R>> taskCls, @Nullable IgfsRecordResolver rslvr, Collection<IgfsPath> paths, boolean skipNonExistentFiles, long maxRangeLen, @Nullable T arg) throws IgniteException
FileSystemConfiguration.getMaximumTaskRangeLength() for more information).executeAsync in interface IgniteFileSystemtaskCls - Task class to execute.rslvr - Optional resolver to control split boundaries.paths - Collection of paths to be processed within this task.skipNonExistentFiles - Whether to skip non existent files. If set to true non-existent files will
be ignored. Otherwise an exception will be thrown.maxRangeLen - Maximum range length.arg - Optional task argument.IgniteException - If execution failed.public void stop(boolean cancel)
public IgfsContext context()
public IgfsInputStream open(IgfsPath path, int bufSize, int seqReadsBeforePrefetch)
open in interface IgniteFileSystempath - File path to read.bufSize - Read buffer size (bytes) or zero to use default value.seqReadsBeforePrefetch - Amount of sequential reads before prefetch is started.public IgfsInputStream open(IgfsPath path)
open in interface IgniteFileSystempath - File path to read.public IgfsInputStream open(IgfsPath path, int bufSize)
open in interface IgniteFileSystempath - File path to read.bufSize - Read buffer size (bytes) or zero to use default value.public IgfsStatus globalSpace() throws IgniteCheckedException
globalSpace in interface IgfsExIgniteCheckedException - If task execution failed.public void globalSampling(@Nullable
Boolean val)
throws IgniteCheckedException
globalSampling in interface IgfsExval - True to turn on sampling, false to turn it off, null to clear sampling state.IgniteCheckedException - If failed.@Nullable public Boolean globalSampling()
globalSampling in interface IgfsExTrue in case sampling is enabled, false otherwise, or null in case sampling
flag is not set.public long groupBlockSize()
groupBlockSize in interface IgfsEx@Nullable public String clientLogDirectory()
clientLogDirectory in interface IgfsExnull in case no client connections have been created yet.public void clientLogDirectory(String logDir)
clientLogDirectory in interface IgfsExlogDir - Client file system log directory.public boolean evictExclude(IgfsPath path, boolean primary)
evictExclude in interface IgfsExpath - Path.primary - Whether the mode is PRIMARY.True if path is excluded from evictions.public IgniteUuid nextAffinityKey()
nextAffinityKey in interface IgfsExpublic boolean isProxy(URI path)
public String name()
name in interface IgniteFileSystempublic FileSystemConfiguration configuration()
configuration in interface IgniteFileSystempublic IgfsPathSummary summary(IgfsPath path)
summary in interface IgniteFileSystempath - Path to get information for.public IgfsOutputStream create(IgfsPath path, boolean overwrite)
create in interface IgniteFileSystempath - File path to create.overwrite - Overwrite file if it already exists. Note: you cannot overwrite an existent directory.public IgfsOutputStream create(IgfsPath path, int bufSize, boolean overwrite, int replication, long blockSize, @Nullable Map<String,String> props)
create in interface IgniteFileSystempath - File path to create.bufSize - Write buffer size (bytes) or zero to use default value.overwrite - Overwrite file if it already exists. Note: you cannot overwrite an existent directory.replication - Replication factor.blockSize - Block size.props - File properties to set.public IgfsOutputStream create(IgfsPath path, int bufSize, boolean overwrite, @Nullable IgniteUuid affKey, int replication, long blockSize, @Nullable Map<String,String> props)
create in interface IgniteFileSystempath - File path to create.bufSize - Write buffer size (bytes) or zero to use default value.overwrite - Overwrite file if it already exists. Note: you cannot overwrite an existent directory.affKey - Affinity key used to store file blocks. If not null, the whole file will be
stored on node where affKey resides.replication - Replication factor.blockSize - Block size.props - File properties to set.public IgfsOutputStream append(IgfsPath path, boolean create)
append in interface IgniteFileSystempath - File path to append.create - Create file if it doesn't exist yet.public IgfsOutputStream append(IgfsPath path, int bufSize, boolean create, @Nullable Map<String,String> props)
append in interface IgniteFileSystempath - File path to append.bufSize - Write buffer size (bytes) or zero to use default value.create - Create file if it doesn't exist yet.props - File properties to set only in case it file was just created.public void setTimes(IgfsPath path, long modificationTime, long accessTime)
null,
corresponding time will not be changed.setTimes in interface IgniteFileSystempath - Path to update.modificationTime - Optional last modification time to set. Value -1 does not update
modification time.accessTime - Optional last access time to set. Value -1 does not update access time.public Collection<IgfsBlockLocation> affinity(IgfsPath path, long start, long len)
affinity in interface IgniteFileSystempath - File path to get affinity for.start - Position in the file to start affinity resolution from.len - Size of data in the file to resolve affinity for.public Collection<IgfsBlockLocation> affinity(IgfsPath path, long start, long len, long maxLen)
maxLen parameter is set and
particular block location length is greater than this value, block locations will be split into smaller
chunks.affinity in interface IgniteFileSystempath - File path to get affinity for.start - Position in the file to start affinity resolution from.len - Size of data in the file to resolve affinity for.maxLen - Maximum length of a single returned block location length.public IgfsMetrics metrics()
metrics in interface IgniteFileSystempublic void resetMetrics()
resetMetrics in interface IgniteFileSystempublic long size(IgfsPath path)
size in interface IgniteFileSystempath - File system path.public boolean exists(IgfsPath path)
exists in interface IgniteFileSystempath - Path to check for existence in the file system.True if such file exists, otherwise - false.@Nullable public IgfsFile update(IgfsPath path, Map<String,String> props)
null values
will be removed from the stored properties or ignored if they don't exist in the file info.
When working in DUAL_SYNC or DUAL_ASYNC modes with Hadoop secondary file system only the following properties will be updated:
usrName - file owner name;grpName - file owner group;permission - Unix-style string representing file permissions.update in interface IgniteFileSystempath - File path to set properties for.props - Properties to update.null if such path does not exist.public void rename(IgfsPath src, IgfsPath dest)
You are free to rename/move data files as you wish, but directories can be only renamed. You cannot move the directory between different parent directories.
Examples:
rename in interface IgniteFileSystemsrc - Source file path to rename.dest - Destination file path. If destination path is a directory, then source file will be placed
into destination directory with original name.public boolean delete(IgfsPath path, boolean recursive)
delete in interface IgniteFileSystempath - File path to delete.recursive - Delete non-empty directories recursively.True in case of success, false otherwise.public void mkdirs(IgfsPath path)
mkdirs in interface IgniteFileSystempath - Path of directories chain to create.public void mkdirs(IgfsPath path, @Nullable Map<String,String> props)
mkdirs in interface IgniteFileSystempath - Path of directories chain to create.props - Metadata properties to set on created directories.public Collection<IgfsPath> listPaths(IgfsPath path)
listPaths in interface IgniteFileSystempath - Path to list files under.public Collection<IgfsFile> listFiles(IgfsPath path)
listFiles in interface IgniteFileSystempath - Path to list files under.@Nullable public IgfsFile info(IgfsPath path)
info in interface IgniteFileSystempath - Path to get information for.null if such path does not exist.public IgfsMode mode(IgfsPath path)
mode in interface IgniteFileSystempath - Path.public long usedSpaceSize()
usedSpaceSize in interface IgniteFileSystempublic IgfsSecondaryFileSystem asSecondary()
asSecondary in interface IgfsEx
Follow @ApacheIgnite
Ignite Fabric : ver. 2.5.0 Release Date : May 23 2018