jackye1995 commented on a change in pull request #3175:
URL: https://github.com/apache/iceberg/pull/3175#discussion_r717282414



##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3OutputStream.java
##########
@@ -328,6 +330,15 @@ private static InputStream uncheckedInputStream(File file) 
{
     }
   }
 
+  private void createStagingDirectoryIfNotExists() throws SecurityException {
+    if (!stagingDirectory.exists()) {
+      boolean createdStagingDirectory = stagingDirectory.mkdirs();
+      if (createdStagingDirectory) {
+        LOG.info("Successfully created staging directory: {}", 
stagingDirectory.getAbsolutePath());
+      }

Review comment:
       actually, we can do better than just logging. When creation fails, we 
can check directory existence again, if it exists then it's created by another 
process, otherwise it's still an issue, and we can throw an IOException with 
error message indicating staging directory creation fails for some unknown 
reasons.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to