HADOOP-15789. DistCp does not clean staging folder if class extends DistCp. Contributed by Lawrence Andrews. (#4534)
Signed-off-by: Ayush Saxena <ayushsaxena@apache.org>
This commit is contained in:
parent
8e39e35bea
commit
96f8e5b6f4
@ -473,14 +473,19 @@ private static Configuration getDefaultConf() {
|
|||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void cleanup() {
|
/**
|
||||||
|
* Clean the staging folder created by distcp.
|
||||||
|
*/
|
||||||
|
protected synchronized void cleanup() {
|
||||||
try {
|
try {
|
||||||
if (metaFolder != null) {
|
if (metaFolder != null) {
|
||||||
|
synchronized (this) {
|
||||||
if (jobFS != null) {
|
if (jobFS != null) {
|
||||||
jobFS.delete(metaFolder, true);
|
jobFS.delete(metaFolder, true);
|
||||||
}
|
}
|
||||||
metaFolder = null;
|
metaFolder = null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.error("Unable to cleanup meta folder: " + metaFolder, e);
|
LOG.error("Unable to cleanup meta folder: " + metaFolder, e);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user