bhattmanish98 commented on code in PR #8137:
URL: https://github.com/apache/hadoop/pull/8137#discussion_r2667151256
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AbfsCountersImpl.java:
##########
@@ -201,20 +201,39 @@ public void initializeWriteResourceUtilizationMetrics() {
@Override
- public void initializeMetrics(MetricFormat metricFormat) {
+ public void initializeMetrics(final MetricFormat metricFormat,
+ final AbfsConfiguration abfsConfiguration) {
switch (metricFormat) {
- case INTERNAL_BACKOFF_METRIC_FORMAT:
- abfsBackoffMetrics = new AbfsBackoffMetrics();
- break;
- case INTERNAL_FOOTER_METRIC_FORMAT:
- abfsReadFooterMetrics = new AbfsReadFooterMetrics();
- break;
- case INTERNAL_METRIC_FORMAT:
- abfsBackoffMetrics = new AbfsBackoffMetrics();
- abfsReadFooterMetrics = new AbfsReadFooterMetrics();
- break;
- default:
- break;
+ case INTERNAL_BACKOFF_METRIC_FORMAT:
+ abfsBackoffMetrics = new AbfsBackoffMetrics(
+ abfsConfiguration.isBackoffRetryMetricsEnabled());
+ break;
+ case INTERNAL_FOOTER_METRIC_FORMAT:
+ initializeReadFooterMetrics();
+ case INTERNAL_METRIC_FORMAT:
+ abfsBackoffMetrics = new AbfsBackoffMetrics(
+ abfsConfiguration.isBackoffRetryMetricsEnabled());
+ initializeReadFooterMetrics();
Review Comment:
Even then we may need two constructors as it is getting used in some test
cases. But as you suggest I can simplify this if else statement in
initializeReadFooterMetrics method.
--
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]