mirror of
https://github.com/vale981/ray
synced 2025-03-12 06:06:39 -04:00

* Initial scheduler commit * global scheduler * add global scheduler * Implement global scheduler skeleton. * Formatting. * Allow local scheduler to be started without a connection to redis so that we can test it without a global scheduler. * Fail if there are no local schedulers when the global scheduler receives a task. * Initialize uninitialized value and formatting fix. * Generalize local scheduler table to db client table. * Remove code duplication in local scheduler and add flag for whether a task came from the global scheduler or not. * Queue task specs in the local scheduler instead of tasks. * Simple global scheduler tests, including valgrind. * Factor out functions for starting processes. * Fixes.
29 lines
939 B
C
29 lines
939 B
C
#include "task.h"
|
|
#include "task_table.h"
|
|
|
|
#include "global_scheduler_algorithm.h"
|
|
|
|
void handle_task_waiting(global_scheduler_state *state, task *task) {
|
|
if (utarray_len(state->local_schedulers) > 0) {
|
|
local_scheduler *scheduler =
|
|
(local_scheduler *) utarray_eltptr(state->local_schedulers, 0);
|
|
assign_task_to_local_scheduler(state, task, scheduler->id);
|
|
} else {
|
|
CHECKM(0, "We currently don't handle this case.");
|
|
}
|
|
}
|
|
|
|
void handle_object_available(global_scheduler_state *state,
|
|
object_id object_id) {
|
|
/* Do nothing for now. */
|
|
}
|
|
|
|
void handle_local_scheduler_heartbeat(global_scheduler_state *state) {
|
|
/* Do nothing for now. */
|
|
}
|
|
|
|
void handle_new_local_scheduler(global_scheduler_state *state,
|
|
db_client_id db_client_id) {
|
|
local_scheduler local_scheduler = {.id = db_client_id};
|
|
utarray_push_back(state->local_schedulers, &local_scheduler);
|
|
}
|