Change TaskSpec to allow multiple object IDs per argument. (#1204)

* Implement object ID bags

* linting

* fix tests

* fix linting

* fix comments
This commit is contained in:
Philipp Moritz
2017-11-10 16:33:34 -08:00
committed by Robert Nishihara
parent 07f0532b9b
commit e798a652bc
11 changed files with 120 additions and 84 deletions
+16 -3
View File
@@ -238,15 +238,25 @@ int64_t TaskSpec_num_returns(TaskSpec *spec);
*/
bool TaskSpec_arg_by_ref(TaskSpec *spec, int64_t arg_index);
/**
* Get number of object IDs in a given argument
*
* @param spec The task_spec in question.
* @param arg_index The index of the argument in question.
* @return number of object IDs in this argument
*/
int TaskSpec_arg_id_count(TaskSpec *spec, int64_t arg_index);
/**
* Get a particular argument to this task. This assumes the argument is an
* object ID.
*
* @param spec The task_spec in question.
* @param arg_index The index of the argument in question.
* @param id_index The index of the object ID in this arg.
* @return The argument at that index.
*/
ObjectID TaskSpec_arg_id(TaskSpec *spec, int64_t arg_index);
ObjectID TaskSpec_arg_id(TaskSpec *spec, int64_t arg_index, int64_t id_index);
/**
* Get a particular argument to this task. This assumes the argument is a value.
@@ -272,11 +282,14 @@ int64_t TaskSpec_arg_length(TaskSpec *spec, int64_t arg_index);
* arguments in their order of appearance.
*
* @param spec The task_spec in question.
* @param The object ID to set the argument to.
* @param object_ids The object IDs to set the argument to.
* @param num_object_ids number of IDs in this param, usually 1.
* @return The number of task arguments that have been set before this one. This
* is only used for testing.
*/
void TaskSpec_args_add_ref(TaskBuilder *spec, ObjectID obj_id);
void TaskSpec_args_add_ref(TaskBuilder *spec,
ObjectID object_ids[],
int num_object_ids);
/**
* Set the next task argument. Note that this API only allows you to set the