Skip to content

Commit

Permalink
HADOOP-19311: [ABFS] Implement Backoff and Read Footer metrics using …
Browse files Browse the repository at this point in the history
…IOStatistics Class (#7122)

Contributed by: Manish Bhatt <bhattmanish98>

Reviewed by: Saikat roy <saikatroy038> and Anuj Modi <[email protected]>
Signed-off by: Anuj Modi
  • Loading branch information
bhattmanish98 authored Feb 6, 2025
1 parent 872ebda commit 57d0979
Show file tree
Hide file tree
Showing 19 changed files with 1,751 additions and 883 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.concurrent.atomic.AtomicLong;

import org.apache.hadoop.classification.VisibleForTesting;
import org.apache.hadoop.fs.azurebfs.services.AbfsBackoffMetrics;
import org.apache.hadoop.fs.azurebfs.services.AbfsCounters;
import org.apache.hadoop.fs.azurebfs.services.AbfsReadFooterMetrics;
import org.apache.hadoop.fs.azurebfs.utils.MetricFormat;
Expand Down Expand Up @@ -69,6 +70,7 @@
import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.SEND_REQUESTS;
import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.SERVER_UNAVAILABLE;
import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.WRITE_THROTTLES;
import static org.apache.hadoop.fs.azurebfs.enums.AbfsBackoffMetricsEnum.TOTAL_NUMBER_OF_REQUESTS;
import static org.apache.hadoop.fs.statistics.impl.IOStatisticsBinding.iostatisticsStore;
import static org.apache.hadoop.util.Time.now;

Expand Down Expand Up @@ -324,18 +326,14 @@ public DurationTracker trackDuration(String key) {
public String toString() {
String metric = "";
if (abfsBackoffMetrics != null) {
long totalNoRequests = getAbfsBackoffMetrics().getTotalNumberOfRequests();
long totalNoRequests = getAbfsBackoffMetrics().getMetricValue(TOTAL_NUMBER_OF_REQUESTS);
if (totalNoRequests > 0) {
metric += "#BO:" + getAbfsBackoffMetrics().toString();
}
}
if (abfsReadFooterMetrics != null) {
Map<String, AbfsReadFooterMetrics> metricsMap = getAbfsReadFooterMetrics().getMetricsMap();
if (metricsMap != null && !(metricsMap.isEmpty())) {
String readFooterMetric = getAbfsReadFooterMetrics().toString();
if (!readFooterMetric.equals("")) {
metric += "#FO:" + getAbfsReadFooterMetrics().toString();
}
if (getAbfsReadFooterMetrics().getTotalFiles() > 0) {
metric += "#FO:" + getAbfsReadFooterMetrics().toString();
}
}
return metric;
Expand Down
Loading

0 comments on commit 57d0979

Please sign in to comment.