public interface IgfsSecondaryFileSystem
Modifier and Type | Method and Description |
---|---|
OutputStream |
append(IgfsPath path,
int bufSize,
boolean create,
Map<String,String> props)
Opens an output stream to an existing file for appending data.
|
OutputStream |
create(IgfsPath path,
boolean overwrite)
Creates a file and opens it for writing.
|
OutputStream |
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 |
exists(IgfsPath path)
Checks if the specified path exists.
|
IgfsFile |
info(IgfsPath path)
Gets file information for the specified path.
|
Collection<IgfsFile> |
listFiles(IgfsPath path)
Lists files under the specified path.
|
Collection<IgfsPath> |
listPaths(IgfsPath path)
Lists file paths under the specified path.
|
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.
|
IgfsSecondaryFileSystemPositionedReadable |
open(IgfsPath path,
int bufSize)
Opens a file for reading.
|
Map<String,String> |
properties()
Gets the implementation specific properties of file system.
|
void |
rename(IgfsPath src,
IgfsPath dest)
Renames/moves a file.
|
IgfsFile |
update(IgfsPath path,
Map<String,String> props)
Updates file information for the specified path.
|
long |
usedSpaceSize()
Gets used space in bytes.
|
boolean exists(IgfsPath path)
path
- Path to check for existence.True
if such file exists, otherwise - false
.IgniteException
- In case of error.IgfsFile update(IgfsPath path, Map<String,String> props) throws IgniteException
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 only the following properties will be propagated
to the secondary file system:
usrName
- file owner name;grpName
- file owner group;permission
- Unix-style string representing file permissions.path
- File path to set properties for.props
- Properties to update.null
if such path does not exist.IgniteException
- In case of error.void rename(IgfsPath src, IgfsPath dest) throws IgniteException
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:
src
- 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.IgniteException
- In case of error.IgfsPathNotFoundException
- If source file doesn't exist.boolean delete(IgfsPath path, boolean recursive) throws IgniteException
path
- File path to delete.recursive
- Delete non-empty directories recursively.True
in case of success, false
otherwise.IgniteException
- In case of error.void mkdirs(IgfsPath path) throws IgniteException
path
- Path of directories chain to create.IgniteException
- In case of error.void mkdirs(IgfsPath path, @Nullable Map<String,String> props) throws IgniteException
path
- Path of directories chain to create.props
- Metadata properties to set on created directories.IgniteException
- In case of error.Collection<IgfsPath> listPaths(IgfsPath path) throws IgniteException
path
- Path to list files under.IgniteException
- In case of error.IgfsPathNotFoundException
- If path doesn't exist.Collection<IgfsFile> listFiles(IgfsPath path) throws IgniteException
path
- Path to list files under.IgniteException
- In case of error.IgfsPathNotFoundException
- If path doesn't exist.IgfsSecondaryFileSystemPositionedReadable open(IgfsPath path, int bufSize) throws IgniteException
path
- File path to read.bufSize
- Read buffer size (bytes) or zero
to use default value.IgniteException
- In case of error.IgfsPathNotFoundException
- If path doesn't exist.OutputStream create(IgfsPath path, boolean overwrite) throws IgniteException
path
- File path to create.overwrite
- Overwrite file if it already exists. Note: you cannot overwrite an existent directory.IgniteException
- In case of error.OutputStream create(IgfsPath path, int bufSize, boolean overwrite, int replication, long blockSize, @Nullable Map<String,String> props) throws IgniteException
path
- 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.IgniteException
- In case of error.OutputStream append(IgfsPath path, int bufSize, boolean create, @Nullable Map<String,String> props) throws IgniteException
path
- 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.IgniteException
- In case of error.IgfsPathNotFoundException
- If path doesn't exist and create flag is false
.IgfsFile info(IgfsPath path) throws IgniteException
path
- Path to get information for.null
if such path does not exist.IgniteException
- In case of error.long usedSpaceSize() throws IgniteException
IgniteException
- In case of error.
Follow @ApacheIgnite
Apache Ignite Fabric : ver. 1.0.0 Release Date : March 31 2015