Introduce non-blocking Plasma API. (#71)

* Implement new plasma client API.

* Formatting fixes.

* Make tests work again.

* Make tests run.

* Comment style.

* Fix bugs with fetch tests.

* Introduce fetch1 flag.

* Remove timer only if present.

* Formatting fixes.

* Don't access object after free.

* Formatting fixes.

* Minor change.

* refactoring plasma datastructures

* Change plasma_request and plasma_reply to use only arrays of object requests.

* some more fixes

* Remove unnecessary methods.

* Trivial.

* fixes

* use plasma_send_reply in return_from_wait1

* Lint.
This commit is contained in:
Ion
2016-12-01 02:15:21 -08:00
committed by Robert Nishihara
parent 58e8bbcb34
commit f89be9699c
16 changed files with 2053 additions and 241 deletions
+3
View File
@@ -149,4 +149,7 @@ typedef unique_id db_client_id;
*/
bool db_client_ids_equal(db_client_id first_id, db_client_id second_id);
#define MAX(x, y) ((x) >= (y) ? (x) : (y))
#define MIN(x, y) ((x) <= (y) ? (x) : (y))
#endif
+1 -1
View File
@@ -250,7 +250,7 @@ int read_bytes(int fd, uint8_t *cursor, size_t length) {
if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) {
continue;
}
return -1;
return -1; /* Errno will be set. */
} else if (0 == nbytes) {
/* Encountered early EOF. */
return -1;
+3
View File
@@ -6,6 +6,7 @@ void object_table_lookup(db_handle *db_handle,
retry_info *retry,
object_table_lookup_done_callback done_callback,
void *user_context) {
CHECK(db_handle != NULL);
init_table_callback(db_handle, object_id, __func__, NULL, retry,
done_callback, redis_object_table_lookup, user_context);
}
@@ -15,6 +16,7 @@ void object_table_add(db_handle *db_handle,
retry_info *retry,
object_table_done_callback done_callback,
void *user_context) {
CHECK(db_handle != NULL);
init_table_callback(db_handle, object_id, __func__, NULL, retry,
done_callback, redis_object_table_add, user_context);
}
@@ -27,6 +29,7 @@ void object_table_subscribe(
retry_info *retry,
object_table_done_callback done_callback,
void *user_context) {
CHECK(db_handle != NULL);
object_table_subscribe_data *sub_data =
malloc(sizeof(object_table_subscribe_data));
utarray_push_back(db_handle->callback_freelist, &sub_data);
+1 -1
View File
@@ -402,7 +402,7 @@ void redis_object_table_subscribe_lookup(redisAsyncContext *c,
if (reply->elements > 0) {
CHECK(reply->element[0]->len == UNIQUE_ID_SIZE);
/* Check that the reply corresponds to the right object ID. */
CHECK(strncmp(reply->element[0]->str, callback_data->id.id,
CHECK(strncmp(reply->element[0]->str, (char *) callback_data->id.id,
UNIQUE_ID_SIZE));
object_table_subscribe_data *data = callback_data->data;
if (data->object_available_callback) {