|
@@ -108,7 +108,7 @@ public class AppLogAggregatorImpl implements AppLogAggregator {
|
|
private final AtomicBoolean waiting = new AtomicBoolean(false);
|
|
private final AtomicBoolean waiting = new AtomicBoolean(false);
|
|
private int logAggregationTimes = 0;
|
|
private int logAggregationTimes = 0;
|
|
private int cleanupOldLogTimes = 0;
|
|
private int cleanupOldLogTimes = 0;
|
|
-
|
|
|
|
|
|
+ private long logFileSizeThreshold;
|
|
private boolean renameTemporaryLogFileFailed = false;
|
|
private boolean renameTemporaryLogFileFailed = false;
|
|
|
|
|
|
private final Map<ContainerId, ContainerLogAggregator> containerLogAggregators =
|
|
private final Map<ContainerId, ContainerLogAggregator> containerLogAggregators =
|
|
@@ -175,6 +175,9 @@ public class AppLogAggregatorImpl implements AppLogAggregator {
|
|
this.nodeId = nodeId;
|
|
this.nodeId = nodeId;
|
|
this.logAggPolicy = getLogAggPolicy(conf);
|
|
this.logAggPolicy = getLogAggPolicy(conf);
|
|
this.recoveredLogInitedTime = recoveredLogInitedTime;
|
|
this.recoveredLogInitedTime = recoveredLogInitedTime;
|
|
|
|
+ this.logFileSizeThreshold =
|
|
|
|
+ conf.getLong(YarnConfiguration.LOG_AGGREGATION_DEBUG_FILESIZE,
|
|
|
|
+ YarnConfiguration.DEFAULT_LOG_AGGREGATION_DEBUG_FILESIZE);
|
|
if (logAggregationFileController == null) {
|
|
if (logAggregationFileController == null) {
|
|
// by default, use T-File Controller
|
|
// by default, use T-File Controller
|
|
this.logAggregationFileController = new LogAggregationTFileController();
|
|
this.logAggregationFileController = new LogAggregationTFileController();
|
|
@@ -327,6 +330,19 @@ public class AppLogAggregatorImpl implements AppLogAggregator {
|
|
uploadedLogsInThisCycle = true;
|
|
uploadedLogsInThisCycle = true;
|
|
List<Path> uploadedFilePathsInThisCycleList = new ArrayList<>();
|
|
List<Path> uploadedFilePathsInThisCycleList = new ArrayList<>();
|
|
uploadedFilePathsInThisCycleList.addAll(uploadedFilePathsInThisCycle);
|
|
uploadedFilePathsInThisCycleList.addAll(uploadedFilePathsInThisCycle);
|
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
|
+ for (Path uploadedFilePath : uploadedFilePathsInThisCycleList) {
|
|
|
|
+ try {
|
|
|
|
+ long fileSize = lfs.getFileStatus(uploadedFilePath).getLen();
|
|
|
|
+ if (fileSize >= logFileSizeThreshold) {
|
|
|
|
+ LOG.debug("Log File " + uploadedFilePath
|
|
|
|
+ + " size is " + fileSize + " bytes");
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e1) {
|
|
|
|
+ LOG.error("Failed to get log file size " + e1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
DeletionTask deletionTask = new FileDeletionTask(delService,
|
|
DeletionTask deletionTask = new FileDeletionTask(delService,
|
|
this.userUgi.getShortUserName(), null,
|
|
this.userUgi.getShortUserName(), null,
|
|
uploadedFilePathsInThisCycleList);
|
|
uploadedFilePathsInThisCycleList);
|