public abstract class UnderFileSystem extends Object
Modifier and Type | Class and Description |
---|---|
static class |
UnderFileSystem.SpaceType |
Constructor and Description |
---|
UnderFileSystem() |
Modifier and Type | Method and Description |
---|---|
abstract void |
close() |
abstract OutputStream |
create(String path) |
abstract OutputStream |
create(String path,
int blockSizeByte) |
abstract OutputStream |
create(String path,
short replication,
int blockSizeByte) |
abstract boolean |
delete(String path,
boolean recursive) |
abstract boolean |
exists(String path) |
static UnderFileSystem |
get(String path)
Get the UnderFileSystem instance according to its schema.
|
static UnderFileSystem |
get(String path,
Object conf)
Get the UnderFileSystem instance according to its scheme and configuration.
|
abstract long |
getBlockSizeByte(String path) |
abstract Object |
getConf()
To get the configuration object for UnderFileSystem.
|
abstract List<String> |
getFileLocations(String path) |
abstract List<String> |
getFileLocations(String path,
long offset) |
abstract long |
getFileSize(String path) |
abstract long |
getModificationTimeMs(String path) |
abstract long |
getSpace(String path,
UnderFileSystem.SpaceType type) |
abstract boolean |
isFile(String path) |
abstract String[] |
list(String path)
Returns an array of strings naming the files and directories in the directory denoted by this
abstract pathname.
|
abstract boolean |
mkdirs(String path,
boolean createParent)
Creates the directory named by this abstract pathname.
|
abstract InputStream |
open(String path) |
static Pair<String,String> |
parse(TachyonURI path)
Transform an input string like hdfs://host:port/dir, hdfs://host:port, file:///dir, /dir into a
pair of address and path.
|
abstract boolean |
rename(String src,
String dst) |
abstract void |
setConf(Object conf)
To set the configuration object for UnderFileSystem.
|
abstract void |
setPermission(String path,
String posixPerm)
Change posix file permission
|
public static UnderFileSystem get(String path)
path
- file path storing over the ufs.IllegalArgumentException
- for unknown schemepublic static UnderFileSystem get(String path, Object conf)
path
- file path storing over the ufsconf
- the configuration object for ufs onlyIllegalArgumentException
- for unknown schemepublic static Pair<String,String> parse(TachyonURI path)
path
- the input path stringpublic abstract void close() throws IOException
IOException
public abstract OutputStream create(String path) throws IOException
IOException
public abstract OutputStream create(String path, int blockSizeByte) throws IOException
IOException
public abstract OutputStream create(String path, short replication, int blockSizeByte) throws IOException
IOException
public abstract boolean delete(String path, boolean recursive) throws IOException
IOException
public abstract boolean exists(String path) throws IOException
IOException
public abstract long getBlockSizeByte(String path) throws IOException
IOException
public abstract Object getConf()
public abstract List<String> getFileLocations(String path) throws IOException
IOException
public abstract List<String> getFileLocations(String path, long offset) throws IOException
IOException
public abstract long getFileSize(String path) throws IOException
IOException
public abstract long getModificationTimeMs(String path) throws IOException
IOException
public abstract long getSpace(String path, UnderFileSystem.SpaceType type) throws IOException
IOException
public abstract boolean isFile(String path) throws IOException
IOException
public abstract String[] list(String path) throws IOException
If this abstract pathname does not denote a directory, then this method returns null
.
Otherwise an array of strings is returned, one for each file or directory in the directory.
Names denoting the directory itself and the directory's parent directory are not included in
the result. Each string is a file name rather than a complete path.
There is no guarantee that the name strings in the resulting array will appear in any specific order; they are not, in particular, guaranteed to appear in alphabetical order.
path
- the path to list.null
if this abstract pathname does not denote a directory, or if an I/O error
occurs.IOException
public abstract boolean mkdirs(String path, boolean createParent) throws IOException
path
- the folder to createcreateParent
- If true, the method creates any necessary but nonexistent parent
directories. Otherwise, the method does not create nonexistent parent directories.true
if and only if the directory was created; false
otherwiseIOException
public abstract InputStream open(String path) throws IOException
IOException
public abstract boolean rename(String src, String dst) throws IOException
IOException
public abstract void setConf(Object conf)
conf
- The configuration object accepted by ufs.public abstract void setPermission(String path, String posixPerm) throws IOException
path
- path of the fileposixPerm
- standard posix permission like "777", "775", etc.IOException
Copyright © 2015. All Rights Reserved.