Skip to content

new feature: build Fs Accessor within async IO operations #6461

@dentiny

Description

@dentiny

Feature Description

I notice when we create an operator for local filesystem, it actually issues sync IO requests.

// If root dir is not exist, we must create it.
if let Err(e) = std::fs::metadata(&root) {
if e.kind() == std::io::ErrorKind::NotFound {
std::fs::create_dir_all(&root).map_err(|e| {
Error::new(ErrorKind::Unexpected, "create root dir failed")
.with_operation("Builder::build")
.with_context("root", root.to_string_lossy())
.set_source(e)
})?;
}
}

While all other operations are async (i.e., read, write, etc), people are likely to use Operator in an async runtime, would be better if operation build is also async.

Problem and Solution

Proposed solution:

  • Make operator creation async, essentially use async IO syscalls.
  • But it's a breaking behavior and API change, likely we will add another async interface.

Additional Context

No response

Are you willing to contribute to the development of this feature?

  • Yes, I am willing to contribute to the development of this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreenhancementNew feature or requestreleases-note/featThe PR implements a new feature or has a title that begins with "feat"services/fs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions