Skip to content

Make DiskManagerBuilder to construct DiskManagers #15319

@alamb

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

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