Object table remove (#139)

* Object table remove redis module

* Test case for object table remove redis module

* Client code for object_table_remove

* Delete object notifications in plasma

* Test for object deletion notifications

* Fix subscribe deletion test

* Address Robert's comments

* free hash table entry
This commit is contained in:
Stephanie Wang
2016-12-19 23:18:57 -08:00
committed by Philipp Moritz
parent cb3e6cde9e
commit d729f9b7ea
15 changed files with 394 additions and 46 deletions
+10
View File
@@ -337,6 +337,16 @@ void handle_object_available(local_scheduler_state *state,
}
}
void handle_object_removed(local_scheduler_state *state, object_id object_id) {
scheduling_algorithm_state *algorithm_state = state->algorithm_state;
available_object *entry;
HASH_FIND(handle, algorithm_state->local_objects, &object_id,
sizeof(object_id), entry);
if (entry != NULL) {
HASH_DELETE(handle, algorithm_state->local_objects, entry);
}
}
int num_tasks_in_queue(scheduling_algorithm_state *algorithm_state) {
task_queue_entry *elt;
int count;
+9
View File
@@ -70,6 +70,15 @@ void handle_object_available(local_scheduler_state *state,
scheduling_algorithm_state *algorithm_state,
object_id object_id);
/**
* This function is called if an object is removed from the local plasma store.
*
* @param state The state of the local scheduler.
* @param object_id ID of the object that was removed.
* @return Void.
*/
void handle_object_removed(local_scheduler_state *state, object_id object_id);
/**
* This function is called when a new worker becomes available
*
+6 -1
View File
@@ -122,7 +122,12 @@ void process_plasma_notification(event_loop *loop,
close(client_sock);
return;
}
handle_object_available(state, state->algorithm_state, object_info.obj_id);
if (object_info.is_deletion) {
handle_object_removed(state, object_info.obj_id);
} else {
handle_object_available(state, state->algorithm_state, object_info.obj_id);
}
}
void reconstruct_object_task_lookup_callback(object_id reconstruct_object_id,