-
Notifications
You must be signed in to change notification settings - Fork 16
Executor scheduler #514
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
base: main
Are you sure you want to change the base?
Executor scheduler #514
Conversation
# Conflicts: # services/Cargo.toml
# Conflicts: # services/src/error.rs
Co-authored-by: Christian Beilschmidt <[email protected]>
# Conflicts: # operators/src/error.rs # services/src/pro/contexts/in_memory.rs
This reverts commit fe648d3.
Restricted Hash and Eq implementation to concrete Key type
# Conflicts: # operators/src/error.rs
… state, i.e., only plots use the executor);
# Conflicts: # services/src/error.rs
…atic result stream. This commit contains implementations for VectorQueryProcessor and RasterQueryProcessor.
# Conflicts: # services/src/error.rs
# Conflicts: # services/src/util/config.rs
# Conflicts: # services/src/error.rs # services/src/util/config.rs
…eating self-referential structs
# Conflicts: # datatypes/src/collections/feature_collection.rs
…or_scheduler # Conflicts: # services/src/error.rs
debug!("Scheduling tasks."); | ||
Self::schedule(executor, new_tasks, threshold).await; | ||
debug!("Finished scheduling tasks."); | ||
}); |
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.
await it?
/// Schedules the given set of tasks. Merging of tasks is performed, if | ||
/// the occurring dead space is below the given threshold. | ||
async fn schedule(executor: Arc<Executor<Desc>>, tasks: TaskMap<Desc>, threshold: f64) { | ||
let merged_tasks = tokio::task::spawn_blocking(move || Self::merge_tasks(tasks, threshold)) |
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.
this is already inside a tokio task, why spawn another one?
} | ||
|
||
/// Merges the tasks with the given threshold | ||
fn merge_tasks(tasks: TaskMap<Desc>, threshold: f64) -> TaskMap<Desc> { |
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.
test?
This PR outdates PR #419. It contains the executor as well as a proof-of-concept implementation of a task-scheduler.
The scheduler collects tasks (e.g., computation) for a fixed amount of time (e.g., 100ms) and tries to merge multiple small tasks into one bigger task to avoid redundant computations.
This is especially useful if clients request data in a tiled fashion.