-
Notifications
You must be signed in to change notification settings - Fork 8.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HADOOP-19311: [ABFS] Implement Backoff and Read Footer metrics using IOStatistics Class #7122
base: trunk
Are you sure you want to change the base?
HADOOP-19311: [ABFS] Implement Backoff and Read Footer metrics using IOStatistics Class #7122
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
private void getRetryMetrics(StringBuilder metricBuilder) { | ||
for (RetryValue retryCount : RETRY_LIST) { | ||
long totalRequests = getMetricValue(TOTAL_REQUESTS, retryCount); | ||
metricBuilder.append("$RCTSI$_").append(retryCount.getValue()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can create a separate constants file for all these acronyms to make it easier to modify if needed later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
All these constants are used specifically for Metric work. They qualify to be added into MetricConstants
class. It make sesne to retain that class and add all these constants there itself.
@@ -242,68 +243,104 @@ public void updateMap(String filePathIdentifier) { | |||
* @param nextReadPos the position of the next read | |||
*/ | |||
public void checkMetricUpdate(final String filePathIdentifier, final int len, final long contentLength, final long nextReadPos) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: (optional) method can be renamed to updateReadMetrics
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/utils/StringUtils.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the account setting template file to add the required configs to be added to run the tests related to metrics,
Also add the test results for All combinations
8.TR :- Total number of requests which were made | ||
9.MRC :- Max retry count across all requests | ||
*/ | ||
private void getMmaMetrics(StringBuilder metricBuilder) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function would only be catering to the backoff or sleep time (like mentioned above for MMA) or the number of requests as well (like here in the function)?
...adoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/TestAbfsBackoffMetrics.java
Outdated
Show resolved
Hide resolved
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
============================================================
|
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the recent changes, design looks simpler now.
Added a few more minor comments. Rest looks good to me.
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AbfsCountersImpl.java
Show resolved
Hide resolved
package org.apache.hadoop.fs.azurebfs.enums; | ||
|
||
/** | ||
* Enum for retry values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can also add where these are used, i.e. Metrics
*/ | ||
|
||
package org.apache.hadoop.fs.azurebfs.enums; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Javadoc for class and where/how it is used
...ls/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBackoffMetrics.java
Show resolved
Hide resolved
private void getRetryMetrics(StringBuilder metricBuilder) { | ||
for (RetryValue retryCount : RETRY_LIST) { | ||
long totalRequests = getMetricValue(TOTAL_REQUESTS, retryCount); | ||
metricBuilder.append("$RCTSI$_").append(retryCount.getValue()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
All these constants are used specifically for Metric work. They qualify to be added into MetricConstants
class. It make sesne to retain that class and add all these constants there itself.
...adoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/enums/AbfsReadFooterMetricsEnum.java
Outdated
Show resolved
Hide resolved
...ls/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBackoffMetrics.java
Outdated
Show resolved
Hide resolved
...ls/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBackoffMetrics.java
Outdated
Show resolved
Hide resolved
|
||
if (totalRequests > 0) { | ||
metricBuilder.append("$MMA$_").append(retryCount.getValue()) | ||
.append("R=").append(format(DOUBLE_PRECISION_FORMAT, (double) getMetricValue(MIN_BACK_OFF, retryCount) / THOUSAND)).append("s") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I was suggesting we can move the logic to format the value iside getMetricValue() method itself.
We can have an overloaded getMetricValue(metric, rertyValue, precision)
which will first internally call the original getMetricValue(metric, retryValue)
and convert that based on precision.
This will simplify these redundant code lines.
...-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/statistics/package-info.java
Outdated
Show resolved
Hide resolved
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AbfsCountersImpl.java
Show resolved
Hide resolved
...ls/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBackoffMetrics.java
Show resolved
Hide resolved
...ls/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBackoffMetrics.java
Outdated
Show resolved
Hide resolved
...ls/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBackoffMetrics.java
Show resolved
Hide resolved
...hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsReadFooterMetrics.java
Show resolved
Hide resolved
🎊 +1 overall
This message was automatically generated. |
Description of PR
JIRA: https://issues.apache.org/jira/browse/HADOOP-19311
Current Flow: We have implemented metrics collection in ABFS flow. We have created a custom AbfsBackoffMetrics and AbfsReadFooterMetrics class which stores all the metrics on the file system level. Our objective is to move away from the custom class implementation and use IOStatisticsStore to store the metrics which is present in hadoop-common.
Changes Made: This PR contains the changes related to storing metrics related to above mentioned classes in IOStatisticStore which is present in hadoop-common. AbstractAbfsStatisticsSource abstract class is created which is implementing IOStatisticsSource interface. This will store IOStatistics of the child metrics class.
Both AbfsBackoffMetrics and AbfsReadFooterMetrics is inheriting AbstractAbfsStatisticsSource and store the respective metrics in IOStatisticsStore.