Skip to content
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

Simplify MemoryManager #4522

Merged
merged 12 commits into from
Dec 19, 2022
Merged
7 changes: 6 additions & 1 deletion datafusion/core/src/execution/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ use crate::config::{
ConfigOptions, OPT_BATCH_SIZE, OPT_COALESCE_BATCHES, OPT_COALESCE_TARGET_BATCH_SIZE,
OPT_FILTER_NULL_JOIN_KEYS, OPT_OPTIMIZER_MAX_PASSES, OPT_OPTIMIZER_SKIP_FAILED_RULES,
};
use crate::execution::{runtime_env::RuntimeEnv, FunctionRegistry};
use crate::execution::{runtime_env::RuntimeEnv, FunctionRegistry, MemoryManager};
use crate::physical_optimizer::enforcement::BasicEnforcement;
use crate::physical_plan::file_format::{plan_to_csv, plan_to_json, plan_to_parquet};
use crate::physical_plan::planner::DefaultPhysicalPlanner;
Expand Down Expand Up @@ -1912,6 +1912,11 @@ impl TaskContext {
self.task_id.clone()
}

/// Return the [`MemoryManager`] associated with this [TaskContext]
pub fn memory_manager(&self) -> &Arc<MemoryManager> {
&self.runtime.memory_manager
}

/// Return the [RuntimeEnv] associated with this [TaskContext]
pub fn runtime_env(&self) -> Arc<RuntimeEnv> {
self.runtime.clone()
Expand Down
Loading