jackye1995 commented on a change in pull request #3175:
URL: https://github.com/apache/iceberg/pull/3175#discussion_r717747863
##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3OutputStream.java
##########
@@ -328,6 +330,26 @@ private static InputStream uncheckedInputStream(File file)
{
}
}
+ private void createStagingDirectoryIfNotExists() throws IOException,
SecurityException {
+ if (!stagingDirectory.exists()) {
+ LOG.info("Staging directory: {} does not exist, trying to create one",
+ stagingDirectory.getAbsolutePath());
+ boolean createdStagingDirectory = stagingDirectory.mkdirs();
+ if (createdStagingDirectory) {
+ LOG.info("Successfully created staging directory: {}",
stagingDirectory.getAbsolutePath());
+ } else {
+ if (stagingDirectory.exists()) {
+ LOG.info("Staging directory: {} is created by another process",
+ stagingDirectory.getAbsolutePath());
+ } else {
+ throw new IOException(String
+ .format("Staging directory: %s creation failed due to some
unknown reason",
Review comment:
nit: match the log message at L346, "Fail to create staging directory
due to some unknown reason: {}"
--
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]