[
https://issues.apache.org/jira/browse/HADOOP-13551?focusedWorklogId=568412&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-568412
]
ASF GitHub Bot logged work on HADOOP-13551:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 18/Mar/21 14:49
Start Date: 18/Mar/21 14:49
Worklog Time Spent: 10m
Work Description: steveloughran commented on a change in pull request
#2778:
URL: https://github.com/apache/hadoop/pull/2778#discussion_r596942733
##########
File path:
hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/statistics/ITestAWSStatisticCollection.java
##########
@@ -0,0 +1,82 @@
+/*
+ * 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.s3a.statistics;
+
+import org.junit.Test;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.s3a.AbstractS3ATestBase;
+import org.apache.hadoop.fs.s3a.S3AFileSystem;
+import org.apache.hadoop.fs.statistics.IOStatistics;
+
+import static org.apache.hadoop.fs.s3a.Constants.DEFAULT_ENDPOINT;
+import static org.apache.hadoop.fs.s3a.Constants.ENDPOINT;
+import static org.apache.hadoop.fs.s3a.S3ATestUtils.getLandsatCSVPath;
+import static org.apache.hadoop.fs.s3a.Statistic.STORE_IO_REQUEST;
+import static
org.apache.hadoop.fs.statistics.IOStatisticAssertions.assertThatStatisticCounter;
+
+/**
+ * Verify that AWS SDK statistics are wired up.
+ * This test tries to read data from US-east-1 and us-west-2 buckets
+ * so as to be confident that the nuances of region mapping
+ * are handed correctly (HADOOP-13551).
+ * The statistics are probed to verify that the wiring up is complete.
+ */
+public class ITestAWSStatisticCollection extends AbstractS3ATestBase {
+
+ private static final Path COMMON_CRAWL_PATH
+ = new Path("s3a://osm-pds/planet/planet-latest.orc");
+
+ @Test
+ public void testLandsatStatistics() throws Throwable {
+ final Configuration conf = getConfiguration();
+ // skips the tests if the lansdat path isn't the default.
+ Path path = getLandsatCSVPath(conf);
+ conf.set(ENDPOINT, DEFAULT_ENDPOINT);
+ conf.unset("fs.s3a.bucket.landsat-pds.endpoint");
+
+ try (S3AFileSystem fs = (S3AFileSystem) path.getFileSystem(conf)) {
+ fs.getObjectMetadata(path);
+ IOStatistics iostats = fs.getIOStatistics();
+ assertThatStatisticCounter(iostats,
+ STORE_IO_REQUEST.getSymbol())
+ .isGreaterThanOrEqualTo(1);
+ }
+ }
+
+ @Test
+ public void testCommonCrawlStatistics() throws Throwable {
+ final Configuration conf = getConfiguration();
+ // skips the tests if the lansdat path isn't the default.
+ Path landsatPath = getLandsatCSVPath(conf);
+
+ Path path = COMMON_CRAWL_PATH;
+ conf.set(ENDPOINT, "");
Review comment:
I wondered about that. Would it better to explicitly say "" or default?
And if I stay at "", comment this fact as a "just to make sure this is always
good?"
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 568412)
Time Spent: 3.5h (was: 3h 20m)
> Collect AwsSdkMetrics in S3A FileSystem IOStatistics
> ----------------------------------------------------
>
> Key: HADOOP-13551
> URL: https://issues.apache.org/jira/browse/HADOOP-13551
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: fs/s3
> Affects Versions: 3.0.0-beta1
> Reporter: Steve Loughran
> Assignee: Steve Loughran
> Priority: Major
> Labels: pull-request-available
> Time Spent: 3.5h
> Remaining Estimate: 0h
>
> The S3A Connector has the ability to pass statistics collected by the AWS SDK
> into the IOStatistics store of the (stream, FS)
> But
> * wiring up doesn't (yet) work
> * its best if there was thread-context level collection, though FS-level
> statistics would be a good start.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]