-
Notifications
You must be signed in to change notification settings - Fork 10
Fix issues seen during delta-rs integration #13
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
Conversation
| } | ||
|
|
||
| /// Write data into an open file. | ||
| pub fn write(&self, buf: &[u8]) -> Result<i32, HdfsErr> { |
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.
To align with the semantics of LocalFileSystem write, and imitate the behavior of https://doc.rust-lang.org/src/std/io/mod.rs.html#1540-1555, which actually allows an empty buffer as input, but writes the whole buffer out.
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.
As
Lines 1464 to 1466 in cadaee5
| // Unlike most Java streams, FSDataOutputStream never does partial writes. | |
| // If we succeeded, all the data was written. | |
| return length; |
hdfsWrite won't write partial contents. Maybe it's better to refine the condition check as follows:if written_len >= 0 { Ok(written_len) } else { Err(HdfsErr::Generic(format!( "Fail to write contents to file {}", self.path() ))) }
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.
Thanks, will do
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.
Reverted, only allow to call with an empty buffer and do nothing for this case.
|
|
||
| if ptr.is_null() { | ||
| Err(HdfsErr::Generic(format!( | ||
| Err(HdfsErr::FileNotFound(format!( |
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.
Mistyped error.
| fn new_hdfs_file(&self, path: &str, file: hdfsFile) -> Result<HdfsFile, HdfsErr> { | ||
| if file.is_null() { | ||
| Err(HdfsErr::Generic(format!( | ||
| Err(HdfsErr::FileNotFound(format!( |
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.
Mistyped error.
yahoNanJing
left a comment
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.
LGTM
* Fix issues seen during delta-rs integration * resolve coments: rm while * minimal changes
No description provided.