You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2020/08/29 17:34:35 UTC

[GitHub] [hadoop] steveloughran commented on a change in pull request #2257: HADOOP-17023 Tune S3AFileSystem.listStatus() api.

steveloughran commented on a change in pull request #2257:
URL: https://github.com/apache/hadoop/pull/2257#discussion_r479671878



##########
File path: hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/performance/OperationCost.java
##########
@@ -110,6 +110,9 @@
   public static final OperationCost LIST_FILES_LIST_OP =
       new OperationCost(0, 1);
 
+  /** listStatus always does a LIST. */
+  public static final OperationCost LIST_STATUS_LIST_OP =
+          new OperationCost(0, 1);

Review comment:
       is this just LIST_OPERATION? IF so, make the new constant a reference to that one to make clear that's what is happening. Probably good to do the same above too

##########
File path: hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/ITestS3AFileOperationCost.java
##########
@@ -176,6 +176,77 @@ public void testCostOfListFilesOnNonExistingDir() throws Throwable {
             .plus(GET_FILE_STATUS_FNFE)));
   }
 
+  @Test
+  public void testCostOfListStatusOnFile() throws Throwable {
+    describe("Performing listStatus() on a file");
+    Path file = path(getMethodName() + ".txt");
+    S3AFileSystem fs = getFileSystem();
+    touch(fs, file);
+    verifyMetrics(() ->
+            fs.listStatus(file),
+            whenRaw(LIST_STATUS_LIST_OP
+                    .plus(GET_FILE_STATUS_ON_FILE)),
+            whenAuthoritative(LIST_STATUS_LIST_OP),
+            whenNonauth(LIST_STATUS_LIST_OP));
+//    resetMetricDiffs();
+//    fs.listStatus(file);
+//    if (!fs.hasMetadataStore()) {
+//      metadataRequests.assertDiffEquals(1);
+//    }
+//    listRequests.assertDiffEquals(1);
+  }
+
+  @Test
+  public void testCostOfListStatusOnEmptyDir() throws Throwable {
+    describe("Performing listStatus() on an empty dir");
+    Path dir = path(getMethodName());
+    S3AFileSystem fs = getFileSystem();
+    fs.mkdirs(dir);
+    verifyMetrics(() ->
+            fs.listStatus(dir),
+            whenRaw(LIST_STATUS_LIST_OP

Review comment:
       nice to see you picking up the new metrics validation I think it makes a big difference. If there are ways it can be improved, feel free to do so.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org