bhattmanish98 commented on code in PR #7265:
URL: https://github.com/apache/hadoop/pull/7265#discussion_r1938978707
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystem.java:
##########
@@ -535,34 +541,20 @@ public boolean rename(final Path src, final Path dst)
throws IOException {
return tryGetFileStatus(qualifiedSrcPath, tracingContext) != null;
}
- FileStatus dstFileStatus = null;
+ FileStatus dstFileStatus = tryGetFileStatus(qualifiedDstPath,
tracingContext);
+ Path adjustedDst = dst;
if (qualifiedSrcPath.equals(qualifiedDstPath)) {
- // rename to itself
- // - if it doesn't exist, return false
- // - if it is file, return true
- // - if it is dir, return false.
- dstFileStatus = tryGetFileStatus(qualifiedDstPath, tracingContext);
- if (dstFileStatus == null) {
+ return dstFileStatus != null && !dstFileStatus.isDirectory();
+ } else if (dstFileStatus != null) {
Review Comment:
In case dstFileStatus is null, we don't want to adjust the destination Path.
Thats why this if else is needed.
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystemStore.java:
##########
@@ -649,18 +647,16 @@ public void deleteFilesystem(TracingContext
tracingContext)
*
* @throws IOException if there is an issue with the operation.
*/
- public void createNonRecursivePreCheck(final Path path,
+ public OutputStream createNonRecursive(final Path path,
+ final FileSystem.Statistics statistics, final boolean overwrite,
+ final FsPermission permission, final FsPermission umask,
TracingContext tracingContext)
throws IOException {
- if (path.getParent() != null) {
- getClient().createNonRecursivePreCheck(path.getParent(),
- tracingContext);
- } else {
- throw new AbfsRestOperationException(HTTP_CONFLICT,
- AzureServiceErrorCode.PATH_CONFLICT.getErrorCode(),
- ERR_CREATE_ON_ROOT,
- null);
- }
+ getClient().createNonRecursivePreCheck(path.getParent(),
Review Comment:
Will add it.
--
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]