|
@@ -501,8 +501,8 @@ public class StagingCommitter extends AbstractS3ACommitter {
|
|
|
|
|
|
/**
|
|
/**
|
|
* Staging committer cleanup includes calling wrapped committer's
|
|
* Staging committer cleanup includes calling wrapped committer's
|
|
- * cleanup method, and removing all destination paths in the final
|
|
|
|
- * filesystem.
|
|
|
|
|
|
+ * cleanup method, and removing staging uploads path and all
|
|
|
|
+ * destination paths in the final filesystem.
|
|
* @param commitContext commit context
|
|
* @param commitContext commit context
|
|
* @param suppressExceptions should exceptions be suppressed?
|
|
* @param suppressExceptions should exceptions be suppressed?
|
|
* @throws IOException IO failures if exceptions are not suppressed.
|
|
* @throws IOException IO failures if exceptions are not suppressed.
|
|
@@ -515,6 +515,9 @@ public class StagingCommitter extends AbstractS3ACommitter {
|
|
maybeIgnore(suppressExceptions, "Cleanup wrapped committer",
|
|
maybeIgnore(suppressExceptions, "Cleanup wrapped committer",
|
|
() -> wrappedCommitter.cleanupJob(
|
|
() -> wrappedCommitter.cleanupJob(
|
|
commitContext.getJobContext()));
|
|
commitContext.getJobContext()));
|
|
|
|
+ maybeIgnore(suppressExceptions, "Delete staging uploads path",
|
|
|
|
+ () -> deleteStagingUploadsParentDirectory(
|
|
|
|
+ commitContext.getJobContext()));
|
|
maybeIgnore(suppressExceptions, "Delete destination paths",
|
|
maybeIgnore(suppressExceptions, "Delete destination paths",
|
|
() -> deleteDestinationPaths(
|
|
() -> deleteDestinationPaths(
|
|
commitContext.getJobContext()));
|
|
commitContext.getJobContext()));
|
|
@@ -543,11 +546,26 @@ public class StagingCommitter extends AbstractS3ACommitter {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * Delete the multipart upload staging directory.
|
|
|
|
+ * @param context job context
|
|
|
|
+ * @throws IOException IO failure
|
|
|
|
+ */
|
|
|
|
+ protected void deleteStagingUploadsParentDirectory(JobContext context)
|
|
|
|
+ throws IOException {
|
|
|
|
+ Path stagingUploadsPath = Paths.getStagingUploadsParentDirectory(
|
|
|
|
+ context.getConfiguration(), getUUID());
|
|
|
|
+ ignoreIOExceptions(LOG,
|
|
|
|
+ "Deleting staging uploads path", stagingUploadsPath.toString(),
|
|
|
|
+ () -> deleteWithWarning(
|
|
|
|
+ stagingUploadsPath.getFileSystem(getConf()),
|
|
|
|
+ stagingUploadsPath,
|
|
|
|
+ true));
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
* Delete the working paths of a job.
|
|
* Delete the working paths of a job.
|
|
* <ol>
|
|
* <ol>
|
|
- * <li>The job attempt path</li>
|
|
|
|
* <li>{@code $dest/__temporary}</li>
|
|
* <li>{@code $dest/__temporary}</li>
|
|
* <li>the local working directory for staged files</li>
|
|
* <li>the local working directory for staged files</li>
|
|
* </ol>
|
|
* </ol>
|
|
@@ -556,14 +574,6 @@ public class StagingCommitter extends AbstractS3ACommitter {
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
*/
|
|
*/
|
|
protected void deleteDestinationPaths(JobContext context) throws IOException {
|
|
protected void deleteDestinationPaths(JobContext context) throws IOException {
|
|
- Path attemptPath = getJobAttemptPath(context);
|
|
|
|
- ignoreIOExceptions(LOG,
|
|
|
|
- "Deleting Job attempt Path", attemptPath.toString(),
|
|
|
|
- () -> deleteWithWarning(
|
|
|
|
- getJobAttemptFileSystem(context),
|
|
|
|
- attemptPath,
|
|
|
|
- true));
|
|
|
|
-
|
|
|
|
// delete the __temporary directory. This will cause problems
|
|
// delete the __temporary directory. This will cause problems
|
|
// if there is >1 task targeting the same dest dir
|
|
// if there is >1 task targeting the same dest dir
|
|
deleteWithWarning(getDestFS(),
|
|
deleteWithWarning(getDestFS(),
|