[ 
https://issues.apache.org/jira/browse/YARN-9629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16869568#comment-16869568
 ] 

Szilard Nemeth commented on YARN-9629:
--------------------------------------

Hi [~adam.antal]!
Thanks for this patch, looks good in overall!
You could improve the method serviceInit in class LogAggregationService if you 
have a bit time.
The if-else chain is becoming quite difficult to read.

I would extract some functions for clarity: 
1. 
{code:java}
if (rollingMonitorInterval <= 0) {
{code}
Could be a method named "isRollingMonitorIntervalDisabled" or something like 
this.

2. 
{code:java}
if (!logAggregationDebugMode && minRollingMonitorInterval <
          YarnConfiguration.MIN_LOG_ROLLING_INTERVAL_SECONDS_SUGGESTED) {
{code}
This could be a method named 
"logWarningIfRollingMonitorIntervalIsLessThanMinimum" or something like this.

3. 

{code:java}
if (rollingMonitorInterval < minRollingMonitorInterval) {
{code}
This could be isRollingMonitorIntervalLessThanMinimum.

I think you will have the idea based on my examples.

> Support configurable MIN_LOG_ROLLING_INTERVAL
> ---------------------------------------------
>
>                 Key: YARN-9629
>                 URL: https://issues.apache.org/jira/browse/YARN-9629
>             Project: Hadoop YARN
>          Issue Type: Improvement
>          Components: log-aggregation, nodemanager, yarn
>    Affects Versions: 3.2.0
>            Reporter: Adam Antal
>            Assignee: Adam Antal
>            Priority: Minor
>         Attachments: YARN-9629.001.patch, YARN-9629.002.patch
>
>
> One of the log-aggregation parameter, the minimum valid value for 
> {{yarn.nodemanager.log-aggregation.roll-monitoring-interval-seconds}} is 
> MIN_LOG_ROLLING_INTERVAL - it has been hardcoded since its addition in 
> YARN-2583. 
> It has been empirically set as 1 hour, as lower values would too frequently 
> put the NodeManagers under pressure. For bigger clusters that is indeed a 
> valid limitation, but for smaller clusters it makes sense and a valid 
> customer usecase to use lower values, even like not so lower 30 mins. At this 
> point this can only be achieved by setting 
> {{yarn.nodemanager.log-aggregation.debug-enabled}}, which I believe should be 
> kept as debug purposes.
> I'm suggesting to make this min configurable, although a warning should be 
> logged in the NodeManager startup when this value is lower than 1 hour.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to