|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.util.ToolBase org.apache.hadoop.fs.FsShell
public class FsShell
Provide command line access to a FileSystem.
Field Summary | |
---|---|
protected FileSystem |
fs
|
Fields inherited from class org.apache.hadoop.util.ToolBase |
---|
conf |
Constructor Summary | |
---|---|
FsShell()
|
Method Summary | |
---|---|
static String |
byteDesc(long len)
Return an abbreviated English-language desc of the byte length |
void |
copy(String srcf,
String dstf,
Configuration conf)
Copy files that match the file pattern srcf to a destination file. |
void |
delete(String srcf,
boolean recursive)
Delete all files that match the file pattern srcf. |
void |
du(String src)
Show the size of all files that match the file pattern src |
void |
dus(String src)
Show the summary disk usage of each dir/file that matches the file pattern src |
void |
init()
|
static String |
limitDecimal(double d,
int placesAfterDecimal)
|
void |
ls(String srcf,
boolean recursive)
Get a listing of all files in that match the file pattern srcf. |
static void |
main(String[] argv)
main() has some simple utility methods |
void |
mkdir(String src)
Create the given dir |
void |
printUsage(String cmd)
Displays format of commands. |
void |
rename(String srcf,
String dstf)
Move files that match the file pattern srcf to a destination file. |
int |
run(String[] argv)
run |
void |
setReplication(short newRep,
String srcf,
boolean recursive)
Set the replication for files that match file pattern srcf if it's a directory and recursive is true, set replication for all the subdirs and those files too. |
Methods inherited from class org.apache.hadoop.util.ToolBase |
---|
doMain, getConf, setConf |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected FileSystem fs
Constructor Detail |
---|
public FsShell()
Method Detail |
---|
public void init() throws IOException
IOException
public void setReplication(short newRep, String srcf, boolean recursive) throws IOException
newRep
- new replication factorsrcf
- a file pattern specifying source filesrecursive
- if need to set replication factor for files in subdirs
IOException
FileSystem.globPaths(Path)
public void ls(String srcf, boolean recursive) throws IOException
srcf
- a file pattern specifying source filesrecursive
- if need to list files in subdirs
IOException
FileSystem.globPaths(Path)
public void du(String src) throws IOException
src
- a file pattern specifying source files
IOException
FileSystem.globPaths(Path)
public void dus(String src) throws IOException
src
- a file pattern specifying source files
IOException
FileSystem.globPaths(Path)
public void mkdir(String src) throws IOException
IOException
public void rename(String srcf, String dstf) throws IOException
srcf
- a file pattern specifying source filesdstf
- a destination local file/directory
IOException
FileSystem.globPaths(Path)
public void copy(String srcf, String dstf, Configuration conf) throws IOException
srcf
- a file pattern specifying source filesdstf
- a destination local file/directory
IOException
FileSystem.globPaths(Path)
public void delete(String srcf, boolean recursive) throws IOException
srcf
- a file pattern specifying source filesrecursive
- if need to delete subdirs
IOException
FileSystem.globPaths(Path)
public static String byteDesc(long len)
public static String limitDecimal(double d, int placesAfterDecimal)
public void printUsage(String cmd)
public int run(String[] argv) throws Exception
argv
- command specific arguments
Exception
public static void main(String[] argv) throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |