slfan1989 commented on code in PR #4797:
URL: https://github.com/apache/hadoop/pull/4797#discussion_r953721092
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/loghandler/NonAggregatingLogHandler.java:
##########
@@ -190,13 +196,24 @@ public void handle(LogHandlerEvent event) {
} catch (IOException e) {
LOG.error("Unable to record log deleter state", e);
}
- try {
- sched.schedule(logDeleter, this.deleteDelaySeconds,
- TimeUnit.SECONDS);
- } catch (RejectedExecutionException e) {
- // Handling this event in local thread before starting threads
- // or after calling sched.shutdownNow().
+ //delete no delay if log size exceed deleteThresholdMb
+ if (enableTriggerDeleteBySize && appLogSize >= deleteThresholdMb *
BYTES_PER_MB) {
+ LOG.info("Log Deletion for application: "
+ + appId + ", with no delay, size=" + appLogSize);
Review Comment:
indentation?
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/loghandler/NonAggregatingLogHandler.java:
##########
@@ -190,13 +196,24 @@ public void handle(LogHandlerEvent event) {
} catch (IOException e) {
LOG.error("Unable to record log deleter state", e);
}
- try {
- sched.schedule(logDeleter, this.deleteDelaySeconds,
- TimeUnit.SECONDS);
- } catch (RejectedExecutionException e) {
- // Handling this event in local thread before starting threads
- // or after calling sched.shutdownNow().
+ //delete no delay if log size exceed deleteThresholdMb
+ if (enableTriggerDeleteBySize && appLogSize >= deleteThresholdMb *
BYTES_PER_MB) {
+ LOG.info("Log Deletion for application: "
+ + appId + ", with no delay, size=" + appLogSize);
logDeleter.run();
+ } else {
+ // Schedule - so that logs are available on the UI till they're
deleted.
+ LOG.info("Scheduling Log Deletion for application: "
+ + appId + ", with delay of "
Review Comment:
indentation?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]