|
@@ -62,6 +62,7 @@ import org.apache.hadoop.mapreduce.v2.jobhistory.JHAdminConfig;
|
|
|
import org.apache.hadoop.mapreduce.v2.jobhistory.JobHistoryUtils;
|
|
|
import org.apache.hadoop.mapreduce.v2.jobhistory.JobIndexInfo;
|
|
|
import org.apache.hadoop.service.AbstractService;
|
|
|
+import org.apache.hadoop.util.ShutdownThreadsHelper;
|
|
|
import org.apache.hadoop.yarn.exceptions.YarnRuntimeException;
|
|
|
|
|
|
import com.google.common.annotations.VisibleForTesting;
|
|
@@ -471,8 +472,8 @@ public class HistoryFileManager extends AbstractService {
|
|
|
private Path intermediateDoneDirPath = null; // Intermediate Done Dir Path
|
|
|
private FileContext intermediateDoneDirFc; // Intermediate Done Dir
|
|
|
// FileContext
|
|
|
-
|
|
|
- private ThreadPoolExecutor moveToDoneExecutor = null;
|
|
|
+ @VisibleForTesting
|
|
|
+ protected ThreadPoolExecutor moveToDoneExecutor = null;
|
|
|
private long maxHistoryAge = 0;
|
|
|
|
|
|
public HistoryFileManager() {
|
|
@@ -544,6 +545,12 @@ public class HistoryFileManager extends AbstractService {
|
|
|
super.serviceInit(conf);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void serviceStop() throws Exception {
|
|
|
+ ShutdownThreadsHelper.shutdownExecutorService(moveToDoneExecutor);
|
|
|
+ super.serviceStop();
|
|
|
+ }
|
|
|
+
|
|
|
private void mkdir(FileContext fc, Path path, FsPermission fsp)
|
|
|
throws IOException {
|
|
|
if (!fc.util().exists(path)) {
|