[
https://issues.apache.org/jira/browse/HADOOP-15726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16607715#comment-16607715
]
Chao Sun commented on HADOOP-15726:
-----------------------------------
Thanks [~xkrogen]. Overall I think this looks great. Some minor comments:
- nit: there's a extra line after the last import statement.
- nit: about the naming, I'm wondering whether {{ThrottledLogHelper}} or
something similar will be better. Just some suggestion :)
- the comment for {{minLogPeriodMs}} is stale - it mentions about lock hold
times.
- why we need a {{timer}} field in the log helper? can we just call
{{Time.monotonicNow}}?
- nit: {{currentLogs = new HashMap<>();}} - maybe change to
{{this.currentLogs}} just to keep it consistent :)
- can we add an assertion to {{log}} to check if {{values.length}} matches
what {{currentLog}} has?
- wondering instead of instantiate a new {{LoggingAction}}, whether we can
clear the existing one. ({{SummaryStatistics#clear()}} helps here).
- another potential approach is a "time based primary", that is, whoever calls
the {{log()}} first will be the primary. Don't know if this makes sense.
> Create utility to limit frequency of log statements
> ---------------------------------------------------
>
> Key: HADOOP-15726
> URL: https://issues.apache.org/jira/browse/HADOOP-15726
> Project: Hadoop Common
> Issue Type: Improvement
> Components: common, util
> Reporter: Erik Krogen
> Assignee: Erik Krogen
> Priority: Major
> Attachments: HADOOP-15726.000.patch
>
>
> There is a common pattern of logging a behavior that is normally extraneous.
> Under some circumstances, such a behavior becomes common, flooding the logs
> and making it difficult to see what else is going on in the system. Under
> such situations it is beneficial to limit how frequently the extraneous
> behavior is logged, while capturing some summary information about the
> suppressed log statements.
> This is currently implemented in {{FSNamesystemLock}} (in HDFS-10713). We
> have additional use cases for this in HDFS-13791, so this is a good time to
> create a common utility for different sites to share this logic.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]