-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf: improve the rename performance. #170
base: master
Are you sure you want to change the base?
Conversation
0a8510c
to
2806d10
Compare
Signed-off-by: Yang Yu <[email protected]>
2806d10
to
afbdde5
Compare
} else { | ||
result = this.copyFile(srcPath, dstPath); | ||
result = this.copyFile(srcPath, destPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src是不是也可以用status
|
||
Pair<CosNFileStatus, CosNFileStatus> renameFileStatusPair = new Pair<>(); | ||
|
||
// Hadoop FileSystem Specification: if not exists(FS, src) : raise FileNotFoundException |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the source file src does not exist, FileNotFoundException should be raised.
HDFS fails without raising an exception; rename() merely returns false.
false -> notfound 兼容性要测下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯,这里要测试下
if (dstFileStatus.isFile()) { | ||
LOG.debug("File: {} already exists.", dstFileStatus.getPath()); | ||
return false; | ||
throw new FileAlreadyExistsException(dstPath.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renaming a file atop an existing file is specified as failing, raising an exception.
HDFS : The rename fails, no exception is raised. Instead the method call simply returns false.
兼容性?
} | ||
|
||
@Override | ||
public int hashCode() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for what?
// For symlink types, the Hadoop file system specification does not provide clear instructions, | ||
// I tested the soft connection in the POSIX file system, and the same behavior is also true. | ||
return true; | ||
} | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dst&src 都为空?上面不有checknull
No description provided.