Skip to content

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

Open
wants to merge 60 commits into
base: main
Choose a base branch
from
Open

Executor scheduler #514

wants to merge 60 commits into from

Conversation

koerberm
Copy link
Contributor

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.

koerberm and others added 30 commits November 23, 2021 16:36
# 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
Restricted Hash and Eq implementation to concrete Key type
# Conflicts:
#	operators/src/error.rs
# 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
# Conflicts:
#	datatypes/src/collections/feature_collection.rs
@koerberm
Copy link
Contributor Author

debug!("Scheduling tasks.");
Self::schedule(executor, new_tasks, threshold).await;
debug!("Finished scheduling tasks.");
});
Copy link
Contributor

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))
Copy link
Contributor

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> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants