mirror of
https://github.com/wassname/ray.git
synced 2026-07-31 12:41:01 +08:00
Merge task table and task log into a single table (#30)
* Merge task table and task log * Fix test in db tests * Address Robert's comments and some better error checking * Add a LOG_FATAL that exits the program
This commit is contained in:
committed by
Philipp Moritz
parent
194bdb1d96
commit
9d1e750e8f
@@ -4,6 +4,7 @@
|
||||
#include "common.h"
|
||||
#include "table.h"
|
||||
#include "db.h"
|
||||
#include "task.h"
|
||||
|
||||
/*
|
||||
* ==== Lookup call and callback ====
|
||||
@@ -123,4 +124,55 @@ typedef struct {
|
||||
void *subscribe_context;
|
||||
} object_table_subscribe_data;
|
||||
|
||||
/*
|
||||
* ==== Result table ====
|
||||
*/
|
||||
|
||||
/**
|
||||
* Callback called when the add/remove operation for a result table entry
|
||||
* completes. */
|
||||
typedef void (*result_table_done_callback)(object_id object_id,
|
||||
void *user_context);
|
||||
|
||||
/**
|
||||
* Add information about a new object to the object table. This
|
||||
* is immutable information like the ID of the task that
|
||||
* created the object.
|
||||
*
|
||||
* @param db_handle Handle to object_table database.
|
||||
* @param object_id ID of the object to add.
|
||||
* @param task_id ID of the task that creates this object.
|
||||
* @param retry Information about retrying the request to the database.
|
||||
* @param done_callback Function to be called when database returns result.
|
||||
* @param user_context Context passed by the caller.
|
||||
* @return Void.
|
||||
*/
|
||||
void result_table_add(db_handle *db_handle,
|
||||
object_id object_id,
|
||||
task_id task_id,
|
||||
retry_info *retry,
|
||||
result_table_done_callback done_callback,
|
||||
void *user_context);
|
||||
|
||||
/** Callback called when the result table lookup completes. */
|
||||
typedef void (*result_table_lookup_callback)(object_id object_id,
|
||||
task *task,
|
||||
void *user_context);
|
||||
|
||||
/**
|
||||
* Lookup the task that created an object in the result table.
|
||||
*
|
||||
* @param db_handle Handle to object_table database.
|
||||
* @param object_id ID of the object to lookup.
|
||||
* @param retry Information about retrying the request to the database.
|
||||
* @param done_callback Function to be called when database returns result.
|
||||
* @param user_context Context passed by the caller.
|
||||
* @return Void.
|
||||
*/
|
||||
void result_table_lookup(db_handle *db_handle,
|
||||
object_id object_id,
|
||||
retry_info *retry,
|
||||
result_table_lookup_callback done_callback,
|
||||
void *user_context);
|
||||
|
||||
#endif /* OBJECT_TABLE_H */
|
||||
|
||||
Reference in New Issue
Block a user