@PublicApi public final class TFS extends org.apache.hadoop.fs.FileSystem
TachyonFS
, which TFS is built on top of.Modifier and Type | Field and Description |
---|---|
static String |
FIRST_COM_PATH |
static String |
RECOMPUTE_PATH |
Constructor and Description |
---|
TFS() |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.fs.FSDataOutputStream |
append(org.apache.hadoop.fs.Path cPath,
int bufferSize,
org.apache.hadoop.util.Progressable progress) |
void |
close() |
org.apache.hadoop.fs.FSDataOutputStream |
create(org.apache.hadoop.fs.Path cPath,
org.apache.hadoop.fs.permission.FsPermission permission,
boolean overwrite,
int bufferSize,
short replication,
long blockSize,
org.apache.hadoop.util.Progressable progress)
Attempts to create a file.
|
org.apache.hadoop.fs.FSDataOutputStream |
createNonRecursive(org.apache.hadoop.fs.Path cPath,
org.apache.hadoop.fs.permission.FsPermission permission,
boolean overwrite,
int bufferSize,
short replication,
long blockSize,
org.apache.hadoop.util.Progressable progress)
Deprecated.
API only for 0.20-append
|
boolean |
delete(org.apache.hadoop.fs.Path path)
Deprecated.
|
boolean |
delete(org.apache.hadoop.fs.Path cPath,
boolean recursive)
Attempts to delete the file or directory with the specified path.
|
long |
getDefaultBlockSize() |
org.apache.hadoop.fs.BlockLocation[] |
getFileBlockLocations(org.apache.hadoop.fs.FileStatus file,
long start,
long len) |
org.apache.hadoop.fs.FileStatus |
getFileStatus(org.apache.hadoop.fs.Path path)
If the file does not exist in Tachyon, query it from HDFS.
|
String |
getScheme()
Gets the URI schema that maps to the FileSystem.
|
TachyonFS |
getTachyonFS()
Returns an object implementing the Tachyon-specific client API.
|
URI |
getUri() |
org.apache.hadoop.fs.Path |
getWorkingDirectory() |
void |
initialize(URI uri,
org.apache.hadoop.conf.Configuration conf)
Sets up a lazy connection to Tachyon through mTFS.
|
protected boolean |
isZookeeperMode()
Determines if zookeeper should be used for the FileSystem.
|
org.apache.hadoop.fs.FileStatus[] |
listStatus(org.apache.hadoop.fs.Path path) |
boolean |
mkdirs(org.apache.hadoop.fs.Path cPath,
org.apache.hadoop.fs.permission.FsPermission permission)
Attempts to create a folder with the specified path.
|
org.apache.hadoop.fs.FSDataInputStream |
open(org.apache.hadoop.fs.Path cPath,
int bufferSize)
Attempts to open the specified file for reading.
|
boolean |
rename(org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst) |
void |
setWorkingDirectory(org.apache.hadoop.fs.Path path) |
addFileSystemForTesting, append, append, checkPath, clearStatistics, closeAll, closeAllForUGI, completeLocalOutput, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyToLocalFile, copyToLocalFile, create, create, create, create, create, create, create, create, create, create, createNewFile, createNonRecursive, deleteOnExit, exists, get, get, get, getAllStatistics, getBlockSize, getCanonicalServiceName, getCanonicalUri, getContentSummary, getDefaultPort, getDefaultReplication, getDefaultUri, getDelegationToken, getFileChecksum, getHomeDirectory, getLength, getLocal, getName, getNamed, getReplication, getStatistics, getStatistics, getUsed, globStatus, globStatus, isDirectory, isFile, listStatus, listStatus, listStatus, makeQualified, mkdirs, mkdirs, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, open, printStatistics, processDeleteOnExit, setDefaultUri, setDefaultUri, setOwner, setPermission, setReplication, setTimes, setVerifyChecksum, startLocalOutput
public static final String FIRST_COM_PATH
public static final String RECOMPUTE_PATH
public String getScheme()
FileSystem.createFileSystem(java.net.URI,
org.apache.hadoop.conf.Configuration)
protected boolean isZookeeperMode()
initialize(java.net.URI, org.apache.hadoop.conf.Configuration)
.public org.apache.hadoop.fs.FSDataOutputStream append(org.apache.hadoop.fs.Path cPath, int bufferSize, org.apache.hadoop.util.Progressable progress) throws IOException
append
in class org.apache.hadoop.fs.FileSystem
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class org.apache.hadoop.fs.FileSystem
IOException
public org.apache.hadoop.fs.FSDataOutputStream create(org.apache.hadoop.fs.Path cPath, org.apache.hadoop.fs.permission.FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, org.apache.hadoop.util.Progressable progress) throws IOException
create
in class org.apache.hadoop.fs.FileSystem
cPath
- path to createpermission
- permissions of the created file/folderoverwrite
- overwrite if file existsbufferSize
- the size in bytes of the buffer to be usedreplication
- under filesystem replication factorblockSize
- block size in bytesprogress
- queryable progressIOException
- if overwrite is not specified and the path already exists or if the path is
a folder@Deprecated public org.apache.hadoop.fs.FSDataOutputStream createNonRecursive(org.apache.hadoop.fs.Path cPath, org.apache.hadoop.fs.permission.FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, org.apache.hadoop.util.Progressable progress) throws IOException
createNonRecursive
in class org.apache.hadoop.fs.FileSystem
cPath
- the file name to openoverwrite
- if a file with this name already exists, then if true, the file will be
overwritten, and if false an error will be thrown.bufferSize
- the size of the buffer to be used.replication
- required block replication for the file.blockSize
- the size in bytes of the buffer to be used.progress
- queryable progressIOException
- if 1) overwrite is not specified and the path already exists, 2) if the
path is a folder, or 3) the parent directory does not existFileSystem.setPermission(Path, FsPermission)
@Deprecated public boolean delete(org.apache.hadoop.fs.Path path) throws IOException
delete
in class org.apache.hadoop.fs.FileSystem
IOException
public boolean delete(org.apache.hadoop.fs.Path cPath, boolean recursive) throws IOException
delete
in class org.apache.hadoop.fs.FileSystem
cPath
- path to deleterecursive
- if true, will attempt to delete all children of the pathIOException
- if the path failed to be deleted due to some constraint (ie. non empty
directory with recursive flag disabled)public long getDefaultBlockSize()
getDefaultBlockSize
in class org.apache.hadoop.fs.FileSystem
public org.apache.hadoop.fs.BlockLocation[] getFileBlockLocations(org.apache.hadoop.fs.FileStatus file, long start, long len) throws IOException
getFileBlockLocations
in class org.apache.hadoop.fs.FileSystem
IOException
public org.apache.hadoop.fs.FileStatus getFileStatus(org.apache.hadoop.fs.Path path) throws IOException
getFileStatus
in class org.apache.hadoop.fs.FileSystem
IOException
public TachyonFS getTachyonFS()
public URI getUri()
getUri
in class org.apache.hadoop.fs.FileSystem
public org.apache.hadoop.fs.Path getWorkingDirectory()
getWorkingDirectory
in class org.apache.hadoop.fs.FileSystem
public void initialize(URI uri, org.apache.hadoop.conf.Configuration conf) throws IOException
initialize
in class org.apache.hadoop.fs.FileSystem
IOException
public org.apache.hadoop.fs.FileStatus[] listStatus(org.apache.hadoop.fs.Path path) throws IOException
listStatus
in class org.apache.hadoop.fs.FileSystem
IOException
public boolean mkdirs(org.apache.hadoop.fs.Path cPath, org.apache.hadoop.fs.permission.FsPermission permission) throws IOException
mkdirs
in class org.apache.hadoop.fs.FileSystem
cPath
- path to createpermission
- permissions to grant the created folderIOException
- if the folder cannot be created (e.g., it already exists)public org.apache.hadoop.fs.FSDataInputStream open(org.apache.hadoop.fs.Path cPath, int bufferSize) throws IOException
open
in class org.apache.hadoop.fs.FileSystem
cPath
- the file name to openbufferSize
- the size in bytes of the buffer to be usedIOException
- if the file cannot be opened (e.g., the path is a folder)public boolean rename(org.apache.hadoop.fs.Path src, org.apache.hadoop.fs.Path dst) throws IOException
rename
in class org.apache.hadoop.fs.FileSystem
IOException
public void setWorkingDirectory(org.apache.hadoop.fs.Path path)
setWorkingDirectory
in class org.apache.hadoop.fs.FileSystem
Copyright © 2015. All Rights Reserved.