zhaohaidao commented on code in PR #5617:
URL: https://github.com/apache/opendal/pull/5617#discussion_r1952904345
##########
core/src/services/hdfs_native/writer.rs:
##########
@@ -15,28 +15,41 @@
// specific language governing permissions and limitations
// under the License.
+use bytes::{Buf, Bytes};
use hdfs_native::file::FileWriter;
-use crate::raw::oio;
+use crate::raw::*;
+use crate::services::hdfs_native::error::parse_hdfs_error;
use crate::*;
pub struct HdfsNativeWriter {
- _f: FileWriter,
+ f: FileWriter,
}
impl HdfsNativeWriter {
pub fn new(f: FileWriter) -> Self {
- HdfsNativeWriter { _f: f }
+ HdfsNativeWriter { f }
}
}
impl oio::Write for HdfsNativeWriter {
- async fn write(&mut self, _bs: Buffer) -> Result<()> {
- todo!()
+ async fn write(&mut self, mut bs: Buffer) -> Result<()> {
+ while bs.has_remaining() {
+ let n = self
+ .f
+ .write(Bytes::copy_from_slice(bs.chunk()))
Review Comment:
Makes sense
--
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]