org.springframework.data.hadoop.fs
Class FsShell
java.lang.Object
org.springframework.data.hadoop.fs.FsShell
- All Implemented Interfaces:
- java.io.Closeable, org.springframework.beans.factory.DisposableBean
public class FsShell
- extends java.lang.Object
- implements java.io.Closeable, org.springframework.beans.factory.DisposableBean
HDFS FileSystem Shell supporting the 'hadoop fs/dfs [x]' commands as methods.
See the official guide for more information.
This class mimics as much as possible the shell behavior yet it is meant to be used in a programmatic way,
that is rather then printing out information, they return object or collections that one can iterate through. If the message is
all that's needed then simply call the returned object Object.toString()
explicitly or implicitly (by printing out or doing string
concatenation).
- Author:
- Hadoop's FsShell authors, Costin Leau
Constructor Summary |
FsShell(org.apache.hadoop.conf.Configuration configuration)
Constructs a new FsShell instance. |
FsShell(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.FileSystem fs)
Constructs a new FsShell instance. |
Method Summary |
java.util.Collection<org.apache.hadoop.fs.Path> |
cat(java.lang.String... uris)
|
java.util.Collection<org.apache.hadoop.fs.Path> |
cat(java.lang.String uri)
|
void |
chgrp(boolean recursive,
java.lang.String group,
java.lang.String... uris)
|
void |
chgrp(boolean recursive,
java.lang.String group,
java.lang.String uri)
|
void |
chgrp(java.lang.String group,
java.lang.String... uris)
|
void |
chgrp(java.lang.String group,
java.lang.String uri)
|
void |
chgrpr(java.lang.String group,
java.lang.String... uris)
|
void |
chgrpr(java.lang.String group,
java.lang.String uri)
|
void |
chmod(boolean recursive,
java.lang.Integer mode,
java.lang.String... uris)
|
void |
chmod(boolean recursive,
java.lang.Integer mode,
java.lang.String uri)
|
void |
chmod(boolean recursive,
java.lang.String mode,
java.lang.String... uris)
|
void |
chmod(boolean recursive,
java.lang.String mode,
java.lang.String uri)
|
void |
chmod(java.lang.Integer mode,
java.lang.String... uris)
|
void |
chmod(java.lang.Integer mode,
java.lang.String uri)
|
void |
chmod(java.lang.String mode,
java.lang.String... uris)
|
void |
chmod(java.lang.String mode,
java.lang.String uri)
|
void |
chmodr(java.lang.Integer mode,
java.lang.String... uris)
|
void |
chmodr(java.lang.Integer mode,
java.lang.String uri)
|
void |
chmodr(java.lang.String mode,
java.lang.String... uris)
|
void |
chmodr(java.lang.String mode,
java.lang.String uri)
|
void |
chown(boolean recursive,
java.lang.String owner,
java.lang.String... uris)
|
void |
chown(boolean recursive,
java.lang.String owner,
java.lang.String uri)
|
void |
chown(java.lang.String mode,
java.lang.String... uris)
|
void |
chown(java.lang.String mode,
java.lang.String uri)
|
void |
chownr(java.lang.String mode,
java.lang.String... uris)
|
void |
chownr(java.lang.String mode,
java.lang.String uri)
|
void |
close()
|
void |
copyFromLocal(java.lang.String src,
java.lang.String dst)
|
void |
copyFromLocal(java.lang.String src,
java.lang.String src2,
java.lang.String... dst)
|
void |
copyToLocal(boolean ignorecrc,
boolean crc,
java.lang.String src,
java.lang.String localdst)
|
void |
copyToLocal(java.lang.String src,
java.lang.String localdst)
|
java.util.Map<org.apache.hadoop.fs.Path,org.apache.hadoop.fs.ContentSummary> |
count(boolean quota,
java.lang.String... uris)
|
java.util.Map<org.apache.hadoop.fs.Path,org.apache.hadoop.fs.ContentSummary> |
count(boolean quota,
java.lang.String uri)
|
java.util.Map<org.apache.hadoop.fs.Path,org.apache.hadoop.fs.ContentSummary> |
count(java.lang.String... uris)
|
java.util.Map<org.apache.hadoop.fs.Path,org.apache.hadoop.fs.ContentSummary> |
count(java.lang.String uri)
|
void |
cp(java.lang.String src,
java.lang.String dst)
|
void |
cp(java.lang.String src,
java.lang.String src2,
java.lang.String... dst)
|
void |
destroy()
|
java.util.Map<org.apache.hadoop.fs.Path,java.lang.Long> |
du(boolean summary,
java.lang.String... strings)
|
java.util.Map<org.apache.hadoop.fs.Path,java.lang.Long> |
du(boolean summary,
java.lang.String string)
|
java.util.Map<org.apache.hadoop.fs.Path,java.lang.Long> |
du(java.lang.String... uris)
|
java.util.Map<org.apache.hadoop.fs.Path,java.lang.Long> |
du(java.lang.String uri)
|
java.util.Map<org.apache.hadoop.fs.Path,java.lang.Long> |
dus(java.lang.String... strings)
|
java.util.Map<org.apache.hadoop.fs.Path,java.lang.Long> |
dus(java.lang.String string)
|
void |
expunge()
|
void |
get(boolean ignorecrc,
boolean crc,
java.lang.String src,
java.lang.String dst)
|
void |
get(java.lang.String src,
java.lang.String dst)
|
void |
getmerge(java.lang.String src,
java.lang.String localdst)
|
void |
getmerge(java.lang.String src,
java.lang.String localdst,
boolean addnl)
|
java.util.Collection<org.apache.hadoop.fs.FileStatus> |
ls(boolean recursive,
java.lang.String... match)
|
java.util.Collection<org.apache.hadoop.fs.FileStatus> |
ls(boolean recursive,
java.lang.String match)
|
java.util.Collection<org.apache.hadoop.fs.FileStatus> |
ls(java.lang.String... match)
|
java.util.Collection<org.apache.hadoop.fs.FileStatus> |
ls(java.lang.String match)
|
java.util.Collection<org.apache.hadoop.fs.FileStatus> |
lsr(java.lang.String... match)
|
java.util.Collection<org.apache.hadoop.fs.FileStatus> |
lsr(java.lang.String match)
|
void |
mkdir(java.lang.String... uris)
|
void |
mkdir(java.lang.String uri)
|
void |
moveFromLocal(java.lang.String localsrc,
java.lang.String dst)
|
void |
moveFromLocal(java.lang.String localsrc,
java.lang.String localsrc2,
java.lang.String... dst)
|
void |
moveToLocal(boolean crc,
java.lang.String src,
java.lang.String dst)
|
void |
moveToLocal(java.lang.String src,
java.lang.String dst)
|
void |
mv(java.lang.String src,
java.lang.String dst)
|
void |
mv(java.lang.String src,
java.lang.String src2,
java.lang.String... dst)
|
void |
put(java.lang.String localsrc,
java.lang.String dst)
|
void |
put(java.lang.String localsrc,
java.lang.String localsrc2,
java.lang.String... dst)
|
void |
rm(boolean recursive,
boolean skipTrash,
java.lang.String... uris)
|
void |
rm(boolean recursive,
java.lang.String... uris)
|
void |
rm(boolean recursive,
java.lang.String uri)
|
void |
rm(java.lang.String... uris)
|
void |
rm(java.lang.String uri)
|
void |
rmr(boolean skipTrash,
java.lang.String... uris)
|
void |
rmr(boolean skipTrash,
java.lang.String uri)
|
void |
rmr(java.lang.String... uris)
|
void |
rmr(java.lang.String uri)
|
void |
setrep(boolean recursive,
short replication,
java.lang.String... uris)
|
void |
setrep(boolean recursive,
short replication,
java.lang.String uri)
|
void |
setrep(long secondsToWait,
boolean recursive,
short replication,
java.lang.String... uris)
|
void |
setrep(long secondsToWait,
boolean recursive,
short replication,
java.lang.String uri)
|
void |
setrep(short replication,
java.lang.String... uris)
|
void |
setrep(short replication,
java.lang.String uri)
|
void |
setrepr(long secondsToWait,
short replication,
java.lang.String... uris)
|
void |
setrepr(long secondsToWait,
short replication,
java.lang.String uri)
|
void |
setrepr(short replication,
java.lang.String... uris)
|
void |
setrepr(short replication,
java.lang.String uri)
|
boolean |
test(boolean exists,
boolean zero,
boolean directory,
java.lang.String uri)
|
boolean |
test(java.lang.String uri)
|
java.util.Collection<java.lang.String> |
text(java.lang.String... uris)
|
java.util.Collection<java.lang.String> |
text(java.lang.String uri)
|
void |
touchz(java.lang.String... uris)
|
void |
touchz(java.lang.String uri)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FsShell
public FsShell(org.apache.hadoop.conf.Configuration configuration)
- Constructs a new
FsShell
instance.
- Parameters:
configuration
- Hadoop configuration to use.
FsShell
public FsShell(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.FileSystem fs)
- Constructs a new
FsShell
instance.
- Parameters:
configuration
- Hadoop configuration to use.fs
- Hadoop file system to use.
destroy
public void destroy()
throws java.lang.Exception
- Specified by:
destroy
in interface org.springframework.beans.factory.DisposableBean
- Throws:
java.lang.Exception
close
public void close()
throws java.io.IOException
- Specified by:
close
in interface java.io.Closeable
- Throws:
java.io.IOException
cat
public java.util.Collection<org.apache.hadoop.fs.Path> cat(java.lang.String uri)
cat
public java.util.Collection<org.apache.hadoop.fs.Path> cat(java.lang.String... uris)
chgrp
public void chgrp(java.lang.String group,
java.lang.String uri)
chgrp
public void chgrp(java.lang.String group,
java.lang.String... uris)
chgrpr
public void chgrpr(java.lang.String group,
java.lang.String uri)
chgrpr
public void chgrpr(java.lang.String group,
java.lang.String... uris)
chgrp
public void chgrp(boolean recursive,
java.lang.String group,
java.lang.String uri)
chgrp
public void chgrp(boolean recursive,
java.lang.String group,
java.lang.String... uris)
chmod
public void chmod(java.lang.String mode,
java.lang.String uri)
chmod
public void chmod(java.lang.String mode,
java.lang.String... uris)
chmodr
public void chmodr(java.lang.String mode,
java.lang.String uri)
chmodr
public void chmodr(java.lang.String mode,
java.lang.String... uris)
chmodr
public void chmodr(java.lang.Integer mode,
java.lang.String uri)
chmodr
public void chmodr(java.lang.Integer mode,
java.lang.String... uris)
chmod
public void chmod(java.lang.Integer mode,
java.lang.String uri)
chmod
public void chmod(java.lang.Integer mode,
java.lang.String... uris)
chmod
public void chmod(boolean recursive,
java.lang.Integer mode,
java.lang.String uri)
chmod
public void chmod(boolean recursive,
java.lang.Integer mode,
java.lang.String... uris)
chmod
public void chmod(boolean recursive,
java.lang.String mode,
java.lang.String uri)
chmod
public void chmod(boolean recursive,
java.lang.String mode,
java.lang.String... uris)
chown
public void chown(java.lang.String mode,
java.lang.String uri)
chown
public void chown(java.lang.String mode,
java.lang.String... uris)
chownr
public void chownr(java.lang.String mode,
java.lang.String uri)
chownr
public void chownr(java.lang.String mode,
java.lang.String... uris)
chown
public void chown(boolean recursive,
java.lang.String owner,
java.lang.String uri)
chown
public void chown(boolean recursive,
java.lang.String owner,
java.lang.String... uris)
copyFromLocal
public void copyFromLocal(java.lang.String src,
java.lang.String dst)
copyFromLocal
public void copyFromLocal(java.lang.String src,
java.lang.String src2,
java.lang.String... dst)
copyToLocal
public void copyToLocal(java.lang.String src,
java.lang.String localdst)
copyToLocal
public void copyToLocal(boolean ignorecrc,
boolean crc,
java.lang.String src,
java.lang.String localdst)
count
public java.util.Map<org.apache.hadoop.fs.Path,org.apache.hadoop.fs.ContentSummary> count(java.lang.String uri)
count
public java.util.Map<org.apache.hadoop.fs.Path,org.apache.hadoop.fs.ContentSummary> count(java.lang.String... uris)
count
public java.util.Map<org.apache.hadoop.fs.Path,org.apache.hadoop.fs.ContentSummary> count(boolean quota,
java.lang.String uri)
count
public java.util.Map<org.apache.hadoop.fs.Path,org.apache.hadoop.fs.ContentSummary> count(boolean quota,
java.lang.String... uris)
cp
public void cp(java.lang.String src,
java.lang.String dst)
cp
public void cp(java.lang.String src,
java.lang.String src2,
java.lang.String... dst)
du
public java.util.Map<org.apache.hadoop.fs.Path,java.lang.Long> du(java.lang.String uri)
du
public java.util.Map<org.apache.hadoop.fs.Path,java.lang.Long> du(java.lang.String... uris)
du
public java.util.Map<org.apache.hadoop.fs.Path,java.lang.Long> du(boolean summary,
java.lang.String string)
du
public java.util.Map<org.apache.hadoop.fs.Path,java.lang.Long> du(boolean summary,
java.lang.String... strings)
dus
public java.util.Map<org.apache.hadoop.fs.Path,java.lang.Long> dus(java.lang.String string)
dus
public java.util.Map<org.apache.hadoop.fs.Path,java.lang.Long> dus(java.lang.String... strings)
expunge
public void expunge()
get
public void get(java.lang.String src,
java.lang.String dst)
get
public void get(boolean ignorecrc,
boolean crc,
java.lang.String src,
java.lang.String dst)
getmerge
public void getmerge(java.lang.String src,
java.lang.String localdst)
getmerge
public void getmerge(java.lang.String src,
java.lang.String localdst,
boolean addnl)
ls
public java.util.Collection<org.apache.hadoop.fs.FileStatus> ls(java.lang.String match)
ls
public java.util.Collection<org.apache.hadoop.fs.FileStatus> ls(java.lang.String... match)
ls
public java.util.Collection<org.apache.hadoop.fs.FileStatus> ls(boolean recursive,
java.lang.String match)
ls
public java.util.Collection<org.apache.hadoop.fs.FileStatus> ls(boolean recursive,
java.lang.String... match)
lsr
public java.util.Collection<org.apache.hadoop.fs.FileStatus> lsr(java.lang.String match)
lsr
public java.util.Collection<org.apache.hadoop.fs.FileStatus> lsr(java.lang.String... match)
mkdir
public void mkdir(java.lang.String uri)
mkdir
public void mkdir(java.lang.String... uris)
moveFromLocal
public void moveFromLocal(java.lang.String localsrc,
java.lang.String dst)
moveFromLocal
public void moveFromLocal(java.lang.String localsrc,
java.lang.String localsrc2,
java.lang.String... dst)
moveToLocal
public void moveToLocal(java.lang.String src,
java.lang.String dst)
moveToLocal
public void moveToLocal(boolean crc,
java.lang.String src,
java.lang.String dst)
mv
public void mv(java.lang.String src,
java.lang.String dst)
mv
public void mv(java.lang.String src,
java.lang.String src2,
java.lang.String... dst)
put
public void put(java.lang.String localsrc,
java.lang.String dst)
put
public void put(java.lang.String localsrc,
java.lang.String localsrc2,
java.lang.String... dst)
rm
public void rm(java.lang.String uri)
rm
public void rm(java.lang.String... uris)
rm
public void rm(boolean recursive,
java.lang.String uri)
rm
public void rm(boolean recursive,
java.lang.String... uris)
rm
public void rm(boolean recursive,
boolean skipTrash,
java.lang.String... uris)
rmr
public void rmr(java.lang.String uri)
rmr
public void rmr(java.lang.String... uris)
rmr
public void rmr(boolean skipTrash,
java.lang.String uri)
rmr
public void rmr(boolean skipTrash,
java.lang.String... uris)
setrep
public void setrep(short replication,
java.lang.String uri)
setrep
public void setrep(short replication,
java.lang.String... uris)
setrep
public void setrep(boolean recursive,
short replication,
java.lang.String uri)
setrep
public void setrep(boolean recursive,
short replication,
java.lang.String... uris)
setrepr
public void setrepr(short replication,
java.lang.String... uris)
setrepr
public void setrepr(short replication,
java.lang.String uri)
setrepr
public void setrepr(long secondsToWait,
short replication,
java.lang.String uri)
setrepr
public void setrepr(long secondsToWait,
short replication,
java.lang.String... uris)
setrep
public void setrep(long secondsToWait,
boolean recursive,
short replication,
java.lang.String uri)
setrep
public void setrep(long secondsToWait,
boolean recursive,
short replication,
java.lang.String... uris)
test
public boolean test(java.lang.String uri)
test
public boolean test(boolean exists,
boolean zero,
boolean directory,
java.lang.String uri)
text
public java.util.Collection<java.lang.String> text(java.lang.String uri)
text
public java.util.Collection<java.lang.String> text(java.lang.String... uris)
touchz
public void touchz(java.lang.String uri)
touchz
public void touchz(java.lang.String... uris)