HADOOP-12119. hadoop fs -expunge does not work for federated namespace (Contributed by J.Andreina)
This commit is contained in:
parent
88ceb382ef
commit
c815344e2e
@ -884,6 +884,9 @@ Release 2.8.0 - UNRELEASED
|
|||||||
HADOOP-12076. Incomplete Cache Mechanism in CredentialProvider API.
|
HADOOP-12076. Incomplete Cache Mechanism in CredentialProvider API.
|
||||||
(Larry McCay via cnauroth)
|
(Larry McCay via cnauroth)
|
||||||
|
|
||||||
|
HADOOP-12119. hadoop fs -expunge does not work for federated namespace
|
||||||
|
(J.Andreina via vinayakumarb)
|
||||||
|
|
||||||
Release 2.7.2 - UNRELEASED
|
Release 2.7.2 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
import org.apache.hadoop.classification.InterfaceAudience;
|
import org.apache.hadoop.classification.InterfaceAudience;
|
||||||
import org.apache.hadoop.classification.InterfaceStability;
|
import org.apache.hadoop.classification.InterfaceStability;
|
||||||
|
import org.apache.hadoop.fs.FileSystem;
|
||||||
import org.apache.hadoop.fs.PathIOException;
|
import org.apache.hadoop.fs.PathIOException;
|
||||||
import org.apache.hadoop.fs.PathIsDirectoryException;
|
import org.apache.hadoop.fs.PathIsDirectoryException;
|
||||||
import org.apache.hadoop.fs.PathIsNotDirectoryException;
|
import org.apache.hadoop.fs.PathIsNotDirectoryException;
|
||||||
@ -195,9 +196,19 @@ protected void processOptions(LinkedList<String> args) throws IOException {
|
|||||||
@Override
|
@Override
|
||||||
protected void processArguments(LinkedList<PathData> args)
|
protected void processArguments(LinkedList<PathData> args)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
FileSystem[] childFileSystems =
|
||||||
|
FileSystem.get(getConf()).getChildFileSystems();
|
||||||
|
if (null != childFileSystems) {
|
||||||
|
for (FileSystem fs : childFileSystems) {
|
||||||
|
Trash trash = new Trash(fs, getConf());
|
||||||
|
trash.expunge();
|
||||||
|
trash.checkpoint();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
Trash trash = new Trash(getConf());
|
Trash trash = new Trash(getConf());
|
||||||
trash.expunge();
|
trash.expunge();
|
||||||
trash.checkpoint();
|
trash.checkpoint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -594,8 +594,18 @@ static class TestLFS extends LocalFileSystem {
|
|||||||
TestLFS() {
|
TestLFS() {
|
||||||
this(new Path(TEST_DIR, "user/test"));
|
this(new Path(TEST_DIR, "user/test"));
|
||||||
}
|
}
|
||||||
TestLFS(Path home) {
|
TestLFS(final Path home) {
|
||||||
super();
|
super(new RawLocalFileSystem() {
|
||||||
|
@Override
|
||||||
|
protected Path getInitialWorkingDirectory() {
|
||||||
|
return makeQualified(home);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Path getHomeDirectory() {
|
||||||
|
return makeQualified(home);
|
||||||
|
}
|
||||||
|
});
|
||||||
this.home = home;
|
this.home = home;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user