public class TfsShell extends Object implements Closeable
| Constructor and Description |
|---|
TfsShell(TachyonConf tachyonConf) |
| Modifier and Type | Method and Description |
|---|---|
int |
cat(TachyonURI path)
Prints the file's contents to the console.
|
void |
close() |
static String |
convertMsToDate(long Millis) |
int |
copyFileToLocal(TachyonURI srcPath,
File dstFile)
Copies a file specified by argv from the filesystem to the local filesystem.
|
int |
copyFromLocal(File srcFile,
TachyonURI dstPath)
Copies a file or directory specified by srcPath from the local filesystem to dstPath in the
Tachyon filesystem space.
|
int |
copyFromLocalWildcard(List<File> srcFiles,
TachyonURI dstPath)
Copies a list of files or directories specified by srcFiles from the local filesystem to
dstPath in the Tachyon filesystem space.
|
int |
copyWildcardToLocal(List<TachyonURI> srcPaths,
File dstFile)
Copies a list of files or directories specified by srcPaths from the Tachyon filesystem to
dstPath in the local filesystem.
|
int |
count(TachyonURI path)
Displays the number of folders and files matching the specified prefix in argv.
|
static Comparator<TachyonURI> |
createTachyonURIComparator() |
int |
du(TachyonURI path)
Displays the size of a file or a directory specified by argv.
|
int |
fileinfo(TachyonURI path)
Displays the file's all blocks info
|
int |
free(TachyonURI path)
Free the given file or folder from tachyon in-memory (recursively freeing all children if a
folder)
|
int |
getCapacityBytes()
Get the capacity of the TachyonFileSystem
|
int |
getNumOfArgs(String cmd)
Return the number of arguments a command should have
|
int |
getUsedBytes()
Get number of bytes used in the TachyonFileSystem
|
int |
load(TachyonURI filePath)
Load a file or directory in Tachyon space, makes it resident in memory.
|
int |
loadMetadata(TachyonURI path)
Loads metadata for the given Tachyon path from UFS.
|
int |
location(TachyonURI path)
Displays a list of hosts that have the file specified in argv stored.
|
int |
ls(TachyonURI path)
Displays information for all directories and files directly under the path specified in argv.
|
int |
lsr(TachyonURI path)
Displays information for all directories and files under the path specified in argv
recursively.
|
static void |
main(String[] argv)
Main method, starts a new TfsShell
|
int |
mkdir(TachyonURI path)
Creates a new directory specified by the path in argv, including any parent folders that are
required.
|
int |
mount(String[] argv)
Mounts a UFS path onto a Tachyon path.
|
int |
pin(TachyonURI path)
Pins the given file or folder (recursively pinning all children if a folder).
|
void |
printUsage()
Method which prints the method to use all the commands.
|
int |
rename(String[] argv)
Renames a file or directory specified by argv.
|
int |
report(TachyonURI path) |
int |
rm(TachyonURI path)
Removes the file specified by argv.
|
int |
rmr(TachyonURI path)
Removes the file or directory specified by argv.
|
int |
run(String[] argv)
Method which determines how to handle the user's request, will display usage help to the user
if command format is incorrect.
|
int |
tail(TachyonURI path)
Prints the file's last 1KB of contents to the console.
|
int |
touch(TachyonURI path)
Creates a 0 byte file specified by argv.
|
int |
unmount(TachyonURI path)
Unmounts a Tachyon path.
|
int |
unpin(TachyonURI path)
Unpins the given file or folder (recursively unpinning all children if a folder).
|
public TfsShell(TachyonConf tachyonConf)
public static void main(String[] argv) throws IOException
argv - [] Array of arguments given by the user's input from the terminalIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic int cat(TachyonURI path) throws IOException
path - The TachyonURI path as the input of the commandIOExceptionpublic int load(TachyonURI filePath) throws IOException
filePath - The TachyonURI path to load into Tachyon memoryIOExceptionpublic int copyFromLocalWildcard(List<File> srcFiles, TachyonURI dstPath) throws IOException
srcFiles - The list of files in the local filesystemdstPath - The TachyonURI of the destinationIOExceptionpublic int copyFromLocal(File srcFile, TachyonURI dstPath) throws IOException
srcFile - The source file in the local filesystemdstPath - The TachyonURI of the destinationIOExceptionpublic int copyWildcardToLocal(List<TachyonURI> srcPaths, File dstFile) throws IOException
srcPaths - The list of files in the Tachyon filesystemdstFile - The destination directory in the local filesystemIOExceptionpublic int copyFileToLocal(TachyonURI srcPath, File dstFile) throws IOException
srcPath - The source TachyonURI (has to be a file)dstFile - The destination file in the local filesystemIOExceptionpublic int count(TachyonURI path) throws IOException
path - The TachyonURI path as the input of the commandIOExceptionpublic int fileinfo(TachyonURI path) throws IOException
path - The TachyonURI path as the input of the commandIOExceptionpublic int location(TachyonURI path) throws IOException
path - The TachyonURI path as the input of the commandIOExceptionpublic static Comparator<TachyonURI> createTachyonURIComparator()
public int ls(TachyonURI path) throws IOException
path - The TachyonURI path as the input of the commandIOExceptionpublic static String convertMsToDate(long Millis)
public int lsr(TachyonURI path) throws IOException
path - The TachyonURI path as the input of the commandIOExceptionpublic int mkdir(TachyonURI path)
path - The TachyonURI path as the input of the commandpublic int getUsedBytes()
public int getCapacityBytes()
public int pin(TachyonURI path)
path - The TachyonURI path as the input of the commandpublic void printUsage()
public int getNumOfArgs(String cmd)
cmd - The commandpublic int mount(String[] argv) throws IOException
argv - Aaray of arguments given by the user's input from the terminalIOException - if an I/O error occurspublic int unmount(TachyonURI path) throws IOException
path - the TachyonURI path as the input of the commandIOException - if an I/O error occurspublic int loadMetadata(TachyonURI path) throws IOException
path - the TachyonURI path as the input of the commandIOException - if an I/O error occurspublic int rename(String[] argv) throws IOException
argv - [] Array of arguments given by the user's input from the terminalIOExceptionpublic int report(TachyonURI path) throws IOException
IOExceptionpublic int rm(TachyonURI path) throws IOException
path - The TachyonURI path as the input of the commandIOExceptionpublic int rmr(TachyonURI path)
path - The TachyonURI path as the input of the commandpublic int du(TachyonURI path) throws IOException
path - The TachyonURI path as the input of the commandIOExceptionpublic int run(String[] argv)
argv - [] Array of arguments given by the user's input from the terminalpublic int tail(TachyonURI path) throws IOException
path - The TachyonURI path as the input of the commandIOExceptionpublic int touch(TachyonURI path) throws IOException
path - The TachyonURI path as the input of the commandIOExceptionpublic int unpin(TachyonURI path) throws IOException
path - The TachyonURI path as the input of the commandIOExceptionpublic int free(TachyonURI path) throws IOException
path - The TachyonURI path as the input of the commandIOExceptionCopyright © 2015. All Rights Reserved.