-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make RuntimeEnvBuilder rather than RuntimeConfig #12157
Conversation
Signed-off-by: Devan <devandbenz@gmail.com>
Signed-off-by: Devan <devandbenz@gmail.com>
Signed-off-by: Devan <devandbenz@gmail.com>
Signed-off-by: Devan <devandbenz@gmail.com>
Signed-off-by: Devan <devandbenz@gmail.com>
Signed-off-by: Devan <devandbenz@gmail.com>
Signed-off-by: Devan <devandbenz@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me -- thank you @devanbenz and @yjshen
I think all we need to do is to merge up from main and this will be ready to merge
I think adding RuntimeEnvBuilder::build_arc()
would make the code even nicer, but it can totally be done as a follow on PR (or never)
/// // Configure a 4k batch size | ||
/// let config = SessionConfig::new() .with_batch_size(4 * 1024); | ||
/// | ||
/// // configure a memory limit of 1GB with 20% slop | ||
/// let runtime_env = RuntimeEnv::new( | ||
/// RuntimeConfig::new() | ||
/// let runtime_env = RuntimeEnvBuilder::new() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
let runtime_config = RuntimeConfig::new() | ||
.with_memory_pool(Arc::new(GreedyMemoryPool::new(pool_size))); | ||
let runtime = Arc::new(RuntimeEnv::new(runtime_config).unwrap()); | ||
let runtime = Arc::new( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as a follow on maybe we could even make a build_arc()
type method to make this even nicer looking
Following the model of https://docs.rs/datafusion/latest/datafusion/datasource/physical_plan/parquet/struct.ParquetExecBuilder.html#method.build_arc
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Thanks again @devanbenz |
Signed-off-by: Devan devandbenz@gmail.com## Which issue does this PR close?
Closes #12156
Rationale for this change
Please see the issue #12156 for rationale.
What changes are included in this PR?
Renames
RuntimeConfig
struct toRuntimeEnvBuilder
to state more clearly its usage. Includes a type alias for backwards compatibility to ensure non-breaking changes.Are these changes tested?
Are there any user-facing changes?