[ 
https://issues.apache.org/jira/browse/HADOOP-16769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17603897#comment-17603897
 ] 

ASF GitHub Bot commented on HADOOP-16769:
-----------------------------------------

mehakmeet commented on code in PR #4842:
URL: https://github.com/apache/hadoop/pull/4842#discussion_r970310907


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/LocalDirAllocator.java:
##########
@@ -396,6 +396,9 @@ public Path getLocalPathForWrite(String pathStr, long size,
       Context ctx = confChanged(conf);
       int numDirs = ctx.localDirs.length;
       int numDirsSearched = 0;
+      long maxCapacity = 0;

Review Comment:
   comment for a better description of this variable, like "Max capacity in any 
directory"...



##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalDirAllocator.java:
##########
@@ -532,4 +533,19 @@ public void testGetLocalPathForWriteForInvalidPaths() 
throws Exception {
     }
   }
 
+  /**
+   * Test to check the LocalDirAllocation for the less space HADOOP-16769.
+   *
+   * @throws Exception
+   */
+  @Test(timeout = 30000)
+  public void testGetLocalPathForWriteForLessSpace() throws Exception {
+    String dir0 = buildBufferDir(ROOT, 0);
+    String dir1 = buildBufferDir(ROOT, 1);
+    conf.set(CONTEXT, dir0 + "," + dir1);
+    LambdaTestUtils.intercept(DiskErrorException.class, "as the max capacity 
in any directory is",

Review Comment:
   use `String.format()` to include the path of the file and size in the 2nd 
argument for the contained string message to verify if the path and size is 
being propagated in the error message.



##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalDirAllocator.java:
##########
@@ -532,4 +533,19 @@ public void testGetLocalPathForWriteForInvalidPaths() 
throws Exception {
     }
   }
 
+  /**
+   * Test to check the LocalDirAllocation for the less space HADOOP-16769.

Review Comment:
   nit: Maybe cut the Hadoop Jira, and write what we are doing in the test, 
like "Test to verify creating files using LocalDirAllocation with file size 
exceeding any directory capacity"...





> LocalDirAllocator to provide diagnostics when file creation fails
> -----------------------------------------------------------------
>
>                 Key: HADOOP-16769
>                 URL: https://issues.apache.org/jira/browse/HADOOP-16769
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: util
>            Reporter: Ramesh Kumar Thangarajan
>            Assignee: Ashutosh Gupta
>            Priority: Minor
>              Labels: pull-request-available
>         Attachments: HADOOP-16769.1.patch, HADOOP-16769.3.patch, 
> HADOOP-16769.4.patch, HADOOP-16769.5.patch, HADOOP-16769.6.patch, 
> HADOOP-16769.7.patch, HADOOP-16769.8.patch
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Log details of requested size and available capacity when file creation is 
> not successuful



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to