[
https://issues.apache.org/jira/browse/HADOOP-19311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17906354#comment-17906354
]
ASF GitHub Bot commented on HADOOP-19311:
-----------------------------------------
bhattmanish98 commented on code in PR #7122:
URL: https://github.com/apache/hadoop/pull/7122#discussion_r1888217851
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/enums/AbfsReadFooterMetricsEnum.java:
##########
@@ -0,0 +1,93 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.fs.azurebfs.enums;
+
+import static org.apache.hadoop.fs.azurebfs.constants.MetricsConstants.FILE;
+import static
org.apache.hadoop.fs.azurebfs.enums.StatisticTypeEnum.TYPE_COUNTER;
+import static org.apache.hadoop.fs.azurebfs.enums.StatisticTypeEnum.TYPE_MEAN;
+
+/**
+ * Enum representing various ABFS read footer metrics.
+ */
+public enum AbfsReadFooterMetricsEnum {
+ TOTAL_FILES("totalFiles", "Total files read", FILE, TYPE_COUNTER),
+ AVG_FILE_LENGTH("avgFileLength", "Average File length", FILE, TYPE_MEAN),
+ AVG_SIZE_READ_BY_FIRST_READ("avgSizeReadByFirstRead", "Average Size read
by first read", FILE, TYPE_MEAN),
+
AVG_OFFSET_DIFF_BETWEEN_FIRST_AND_SECOND_READ("avgOffsetDiffBetweenFirstAndSecondRead",
+ "Average Offset difference between first and second read", FILE,
TYPE_MEAN),
+ AVG_READ_LEN_REQUESTED("avgReadLenRequested", "Average Read length
requested", FILE, TYPE_MEAN),
+ AVG_FIRST_OFFSET_DIFF("avgFirstOffsetDiff", "Average First offset
difference", FILE, TYPE_MEAN),
+ AVG_SECOND_OFFSET_DIFF("avgSecondOffsetDiff", "Average Second offset
difference", FILE, TYPE_MEAN);
+
+ private final String name;
+ private final String description;
+ private final String type;
+ private final StatisticTypeEnum statisticType;
+
+ /**
+ * Constructor for AbfsReadFooterMetricsEnum.
+ *
+ * @param name the name of the metric
+ * @param description the description of the metric
+ * @param type the type of the metric (FILE)
+ * @param statisticType the statistic type of the metric (counter or gauge)
+ */
+ AbfsReadFooterMetricsEnum(String name, String description, String type,
StatisticTypeEnum statisticType) {
Review Comment:
Done!
> [ABFS] Implement Backoff and Read Footer metrics using IOStatistics Class
> -------------------------------------------------------------------------
>
> Key: HADOOP-19311
> URL: https://issues.apache.org/jira/browse/HADOOP-19311
> Project: Hadoop Common
> Issue Type: Task
> Components: fs/azure
> Affects Versions: 3.5.0, 3.4.1
> Reporter: Manish Bhatt
> Assignee: Manish Bhatt
> Priority: Major
> Labels: pull-request-available
>
> 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.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]