forked from ray-project/ray-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API for task log and scheduled task (ray-project#25)
* API revision * update * make status a bitmap * update api * tests working * new task log APIs * update APIs * write binary structures to redis * update tests * fix clang-format * Fix formatting.
- Loading branch information
1 parent
084220b
commit e21e9f6
Showing
12 changed files
with
306 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#ifndef TASK_LOG_H | ||
#define TASK_LOG_H | ||
|
||
#include "db.h" | ||
#include "task.h" | ||
|
||
/* The task log is a message bus that is used for all communication between | ||
* local and global schedulers (and also persisted to the state database). | ||
* Here are examples of events that are recorded by the task log: | ||
* | ||
* 1) local scheduler writes it when submits a task to the global scheduler; | ||
* 2) global scheduler reads it to get the task submitted by local schedulers; | ||
* 3) global scheduler writes it when assigning the task to a local scheduler; | ||
* 4) local scheduler reads it to get its tasks assigned by global scheduler; | ||
* 5) local scheduler writes it when a task finishes execution; | ||
* 6) global scheduler reads it to get the tasks that have finished; */ | ||
|
||
/* Callback for subscribing to the task log. */ | ||
typedef void (*task_log_callback)(task_instance *task_instance, void *userdata); | ||
|
||
/* Initially add a task instance to the task log. */ | ||
void task_log_add_task(db_handle *db, task_instance *task_instance); | ||
|
||
/* Update task instance in the task log. */ | ||
void task_log_update_task(db_handle *db, | ||
task_iid task_iid, | ||
int32_t state, | ||
node_id node); | ||
|
||
/* Register callback for a certain event. The node specifies the node whose | ||
* events we want to listen to. If you want to listen to all events for this | ||
* node, use state_filter = | ||
* TASK_WAITING | TASK_SCHEDULED | TASK_RUNNING | TASK_DONE. | ||
* If you want to register to updates from all nodes, set node = NIL_ID. */ | ||
void task_log_register_callback(db_handle *db, | ||
task_log_callback callback, | ||
node_id node, | ||
int32_t state_filter, | ||
void *userdata); | ||
|
||
#endif /* TASK_LOG_H */ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.