You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "Ji-Xinyou (via GitHub)" <gi...@apache.org> on 2023/07/12 19:48:16 UTC
[GitHub] [incubator-opendal] Ji-Xinyou opened a new pull request, #2626: feat(services/fs): impl Sink for Fs
Ji-Xinyou opened a new pull request, #2626:
URL: https://github.com/apache/incubator-opendal/pull/2626
Implement Sink for service Fs.
Part of #2084
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-opendal] Ji-Xinyou commented on a diff in pull request #2626: feat(services/fs): impl Sink for Fs
Posted by "Ji-Xinyou (via GitHub)" <gi...@apache.org>.
Ji-Xinyou commented on code in PR #2626:
URL: https://github.com/apache/incubator-opendal/pull/2626#discussion_r1262181470
##########
core/src/services/fs/writer.rs:
##########
@@ -68,7 +68,7 @@ impl oio::Write for FsWriter<tokio::fs::File> {
async fn sink(&mut self, _size: u64, mut s: oio::Streamer) -> Result<()> {
while let Some(bytes) = s.next().await {
let b = bytes?;
- self.f.write_all(&b).await.map_err(parse_io_error)?;
+ self.f.write(b).await.map_err(parse_io_error)?;
}
Review Comment:
My bad, i thought self.f was calling the function `write` in `oio::Writer`
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-opendal] Xuanwo commented on pull request #2626: feat(services/fs): impl Sink for Fs
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on PR #2626:
URL: https://github.com/apache/incubator-opendal/pull/2626#issuecomment-1633524554
> 2023-07-12T19:54:49.550149Z ERROR opendal::services: service=fs operation=Writer::abort path=941c2285-a2a1-4502-86d1-ad1cd4e17b2e written=2725021 -> abort writer failed: Unsupported (permanent) at Writer::abort => output writer doesn't support abort
It is a bit unusual that `test_writer_sink` does not call `abort`.
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-opendal] Xuanwo merged pull request #2626: feat(services/fs): impl Sink for Fs
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo merged PR #2626:
URL: https://github.com/apache/incubator-opendal/pull/2626
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-opendal] suyanhanx commented on a diff in pull request #2626: feat(services/fs): impl Sink for Fs
Posted by "suyanhanx (via GitHub)" <gi...@apache.org>.
suyanhanx commented on code in PR #2626:
URL: https://github.com/apache/incubator-opendal/pull/2626#discussion_r1262172149
##########
core/src/services/fs/writer.rs:
##########
@@ -68,7 +68,7 @@ impl oio::Write for FsWriter<tokio::fs::File> {
async fn sink(&mut self, _size: u64, mut s: oio::Streamer) -> Result<()> {
while let Some(bytes) = s.next().await {
let b = bytes?;
- self.f.write_all(&b).await.map_err(parse_io_error)?;
+ self.f.write(b).await.map_err(parse_io_error)?;
}
Review Comment:
We should count the size and update the position.
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-opendal] Ji-Xinyou commented on pull request #2626: feat(services/fs): impl Sink for Fs
Posted by "Ji-Xinyou (via GitHub)" <gi...@apache.org>.
Ji-Xinyou commented on PR #2626:
URL: https://github.com/apache/incubator-opendal/pull/2626#issuecomment-1633130893
Although the writer_sink test passed, I saw an error on calling to abort in the test. It seems the `abort` should not be called in this test case?
```
test services_fs::test_writer_sink ... ok
2023-07-12T19:54:49.547758Z DEBUG opendal::services: service=fs operation=write path=941c2285-a2a1-4502-86d1-ad1cd4e17b2e -> started
at core\src\layers\logging.rs:304
2023-07-12T19:54:49.548208Z DEBUG opendal::services: service=fs operation=write path=941c2285-a2a1-4502-86d1-ad1cd4e17b2e -> start writing
at core\src\layers\logging.rs:316
2023-07-12T19:54:49.550149Z ERROR opendal::services: service=fs operation=Writer::abort path=941c2285-a2a1-4502-86d1-ad1cd4e17b2e written=2725021 -> abort writer failed: Unsupported (permanent) at Writer::abort => output writer doesn't support abort
```
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-opendal] Xuanwo commented on a diff in pull request #2626: feat(services/fs): impl Sink for Fs
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #2626:
URL: https://github.com/apache/incubator-opendal/pull/2626#discussion_r1261962145
##########
core/src/services/fs/writer.rs:
##########
@@ -64,11 +65,13 @@ impl oio::Write for FsWriter<tokio::fs::File> {
Ok(())
}
- async fn sink(&mut self, _size: u64, _s: oio::Streamer) -> Result<()> {
- Err(Error::new(
- ErrorKind::Unsupported,
- "Write::sink is not supported",
- ))
+ async fn sink(&mut self, _size: u64, mut s: oio::Streamer) -> Result<()> {
+ while let Some(bytes) = s.next().await {
+ let b = bytes?;
+ self.f.write_all(&b).await.map_err(parse_io_error)?;
Review Comment:
self.pos is not updated.
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org