-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Is your feature request related to a problem or challenge?
While making a reproducer #12136, I found configuring the SessionContext to use a memory limit and disk manager quite akward
Here is what I had to do
let mem_limit = 10 * 1024 * 1024;
let pool = FairSpillPool::new(mem_limit);
let config = RuntimeConfig::new()
.with_memory_pool(Arc::new(pool))
.with_disk_manager(DiskManagerConfig::new());
let runtime_env = RuntimeEnv::new(config)?;
let builder = SessionStateBuilder::new().with_runtime_env(Arc::new(runtime_env));
let ctx = SessionContext::new_with_state(builder.build());Describe the solution you'd like
It would be nice to have the configurations be more of a builder style
Perhaps the example from above could look something more like the following (with some examples):
let mem_limit = 10 * 1024 * 1024;
let runtime_env = RuntimeConfig::new()
.with_memory_pool(Arc::new(FairSpillPool::new(mem_limit)))
.with_disk_manager(DiskManagerConfig::new());
// Change: add a build method to RuntimeConfig to
.builder();
let builder = SessionStateBuilder::new()
.with_runtime_env(Arc::new(runtime_env));
let ctx = SessionContext::new_with_state(builder.build());Describe alternatives you've considered
No response
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers