Skip to content
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

Open
wants to merge 32 commits into
base: trunk
Choose a base branch
from

Conversation

bhattmanish98
Copy link
Contributor

@bhattmanish98 bhattmanish98 commented Oct 17, 2024

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.

@hadoop-yetus

This comment was marked as outdated.

@hadoop-yetus

This comment was marked as outdated.

@hadoop-yetus

This comment was marked as outdated.

@hadoop-yetus

This comment was marked as outdated.

@hadoop-yetus

This comment was marked as outdated.

@hadoop-yetus

This comment was marked as outdated.

@hadoop-yetus

This comment was marked as outdated.

@hadoop-yetus

This comment was marked as outdated.

@hadoop-yetus

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())
Copy link
Contributor

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

Copy link
Contributor

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) {
Copy link
Contributor

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

@apache apache deleted a comment from hadoop-yetus Nov 25, 2024
Copy link
Contributor

@anujmodi2021 anujmodi2021 left a 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) {
Copy link
Contributor

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)?

@hadoop-yetus

This comment was marked as outdated.

@hadoop-yetus

This comment was marked as outdated.

@hadoop-yetus

This comment was marked as outdated.

@bhattmanish98
Copy link
Contributor Author

============================================================
HNS-OAuth

[WARNING] Tests run: 166, Failures: 0, Errors: 0, Skipped: 4
[WARNING] Tests run: 653, Failures: 0, Errors: 0, Skipped: 83
[WARNING] Tests run: 171, Failures: 0, Errors: 0, Skipped: 25
[WARNING] Tests run: 262, Failures: 0, Errors: 0, Skipped: 23

============================================================
HNS-SharedKey

[WARNING] Tests run: 166, Failures: 0, Errors: 0, Skipped: 5
[WARNING] Tests run: 653, Failures: 0, Errors: 0, Skipped: 35
[WARNING] Tests run: 171, Failures: 0, Errors: 0, Skipped: 25
[WARNING] Tests run: 262, Failures: 0, Errors: 0, Skipped: 10

============================================================
NonHNS-SharedKey

[WARNING] Tests run: 166, Failures: 0, Errors: 0, Skipped: 12
[WARNING] Tests run: 637, Failures: 0, Errors: 0, Skipped: 278
[WARNING] Tests run: 171, Failures: 0, Errors: 0, Skipped: 27
[WARNING] Tests run: 262, Failures: 0, Errors: 0, Skipped: 11

============================================================
AppendBlob-HNS-OAuth

[WARNING] Tests run: 166, Failures: 0, Errors: 0, Skipped: 4
[WARNING] Tests run: 653, Failures: 0, Errors: 0, Skipped: 85
[WARNING] Tests run: 171, Failures: 0, Errors: 0, Skipped: 49
[WARNING] Tests run: 262, Failures: 0, Errors: 0, Skipped: 23

@hadoop-yetus

This comment was marked as outdated.

@bhattmanish98 bhattmanish98 changed the title Hadoop-19311. [ABFS] Implement Backoff and Read Footer metrics using IOStatistics Class Hadoop-19311: [ABFS] Implement Backoff and Read Footer metrics using IOStatistics Class Dec 17, 2024
@bhattmanish98 bhattmanish98 changed the title Hadoop-19311: [ABFS] Implement Backoff and Read Footer metrics using IOStatistics Class HADOOP-19311: [ABFS] Implement Backoff and Read Footer metrics using IOStatistics Class Dec 17, 2024
Copy link
Contributor

@anujmodi2021 anujmodi2021 left a 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.

package org.apache.hadoop.fs.azurebfs.enums;

/**
* Enum for retry values.
Copy link
Contributor

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;

Copy link
Contributor

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

private void getRetryMetrics(StringBuilder metricBuilder) {
for (RetryValue retryCount : RETRY_LIST) {
long totalRequests = getMetricValue(TOTAL_REQUESTS, retryCount);
metricBuilder.append("$RCTSI$_").append(retryCount.getValue())
Copy link
Contributor

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.


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")
Copy link
Contributor

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.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 12m 50s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 5 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 36m 55s trunk passed
+1 💚 compile 0m 39s trunk passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu120.04
+1 💚 compile 0m 36s trunk passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu220.04-ga
+1 💚 checkstyle 0m 35s trunk passed
+1 💚 mvnsite 0m 40s trunk passed
+1 💚 javadoc 0m 45s trunk passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu120.04
+1 💚 javadoc 0m 34s trunk passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu220.04-ga
+1 💚 spotbugs 1m 12s trunk passed
+1 💚 shadedclient 33m 8s branch has no errors when building and testing our client artifacts.
-0 ⚠️ patch 33m 29s Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 28s the patch passed
+1 💚 compile 0m 31s the patch passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu120.04
+1 💚 javac 0m 31s the patch passed
+1 💚 compile 0m 27s the patch passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu220.04-ga
+1 💚 javac 0m 27s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 19s the patch passed
+1 💚 mvnsite 0m 30s the patch passed
+1 💚 javadoc 0m 28s the patch passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu120.04
+1 💚 javadoc 0m 26s the patch passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu220.04-ga
+1 💚 spotbugs 1m 4s the patch passed
+1 💚 shadedclient 32m 31s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 2m 37s hadoop-azure in the patch passed.
+1 💚 asflicense 0m 37s The patch does not generate ASF License warnings.
129m 15s
Subsystem Report/Notes
Docker ClientAPI=1.47 ServerAPI=1.47 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7122/20/artifact/out/Dockerfile
GITHUB PR #7122
JIRA Issue HADOOP-19311
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 1289fe3943d9 5.15.0-126-generic #136-Ubuntu SMP Wed Nov 6 10:38:22 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / bd4b131
Default Java Private Build-1.8.0_432-8u432-gaus1-0ubuntu220.04-ga
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_432-8u432-gaus1-0ubuntu220.04-ga
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7122/20/testReport/
Max. process+thread count 552 (vs. ulimit of 5500)
modules C: hadoop-tools/hadoop-azure U: hadoop-tools/hadoop-azure
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7122/20/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants