Skip to content

Make DiskManagerBuilder to construct DiskManagers #15319

Closed

Description

@alamb

Is your feature request related to a problem or challenge?

Creating a DiskManager today is somewhat awkward as described by @2010YOUY01 in #14975 (comment)

It would be nice to follow the builder pattern that is used elsewhere in DataFusion such a RuntimeEnvBuilder -- see example

Describe the solution you'd like

I would like to have an API that looks like this (the with_max_temp_directory_size is part of #14975)

let manager: Arc<DiskManager> = DiskManagerBuilder::new()
  .with_max_temp_directory_size(100*1024*1024)
  .build_arc();

Describe alternatives you've considered

I suggest:

  1. Renaming DiskManagerConfig to DiskManagerBuilder
  2. Leave a backwards compatible deprecated type (like is here
    #[deprecated(since = "43.0.0", note = "please use `RuntimeEnvBuilder` instead")]
    pub type RuntimeConfig = RuntimeEnvBuilder;
    )
  3. Deprecate DiskManager::try_new
  4. Add documentation example on DiskManager, similarly to the example on RuntimeEnv

Additional context

No response

Activity

  1. changed the title [-]Make `DiskManagerBuilder`[/-] [+]Make `DiskManagerBuilder` to construct DiskManagers[/+] on Mar 19, 2025
  2. Standing-Man commented on Mar 20, 2025

    @Standing-Man
    Contributor

    take

  3. Standing-Man commented on Mar 20, 2025

    @Standing-Man
    Contributor

    Hi @alamb, If the PR has been closed, should the issue still remain open?

  4. 2010YOUY01 commented on Mar 20, 2025

    @2010YOUY01
    Contributor

    Hi @alamb, If the PR has been closed, should the issue still remain open?

    Yes, we're exploring an alternative to that PR, but this issue is still intentional. We'd like to be able to build the DiskManager like this issue's example, which is not possible for the current implementation.

  5. alamb commented on Mar 20, 2025

    @alamb
    ContributorAuthor

    Agreed -- I think this API change is beneficial regardless

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions