-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
End-to-end object size information passthrough #90
Conversation
atumanov
commented
Dec 6, 2016
- pass through object size information from Plasma store to Plasma manager to Redis.
- add object subscribe methods for schedulers to listen to object information.
57b88e1
to
bd84c69
Compare
@@ -71,6 +72,24 @@ void process_new_db_client(db_client_id db_client_id, | |||
} | |||
} | |||
|
|||
/* object table subscribe callback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you bring these comments in the same format as the other format strings?
first line: /**
second line: * with a one line description of the fct
third line: *
then the args
then @return Void.
@@ -571,6 +571,12 @@ int plasma_wait(plasma_connection *conn, | |||
plasma_free_request(req); | |||
int64_t return_size = plasma_reply_size(num_returns); | |||
plasma_reply *reply = malloc(return_size); | |||
int rv = plasma_receive_reply(conn->manager_conn, return_size, reply); | |||
if (rv < 0) { | |||
fprintf(stderr, "plasma_wait: failed with rv=%d, errno=%d, errno=%s\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use checkm (with a message) here, it will automatically print the errno
typedef struct { | ||
object_id obj_id; | ||
int64_t data_size; | ||
} objectid_notification; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we rename this to object_id_notification to be consistent with the rest of the code?
retry_info retry = { | ||
.num_retries = NUM_RETRIES, | ||
.timeout = MANAGER_TIMEOUT, | ||
.fail_callback = NULL, | ||
}; | ||
/* Read the notification from Plasma. */ | ||
int error = read_bytes(client_sock, (uint8_t *) &obj_id, sizeof(obj_id)); | ||
objectid_notification objid_notification; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider obj_id_notification here
entry->object_id = obj_id; | ||
HASH_ADD(hh, state->local_available_objects, object_id, sizeof(object_id), | ||
entry); | ||
memcpy(&entry->object_id, &objid_notification.obj_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not entry->object_id = obj_id_notification.obj_id?
@@ -400,10 +400,21 @@ void send_notifications(event_loop *loop, | |||
for (int i = 0; i < utarray_len(queue->object_ids); ++i) { | |||
object_id *obj_id = (object_id *) utarray_eltptr(queue->object_ids, i); | |||
/* Attempt to send a notification about this object ID. */ | |||
int nbytes = send(client_sock, (char const *) obj_id, sizeof(*obj_id), 0); | |||
object_table_entry *entry; /* Points to an element from a hash table. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make comment at the end of the line more precise
sizeof(object_id), entry); | ||
/* Populate and send object id notification. */ | ||
objid_notification.data_size = entry->info.data_size; | ||
memcpy(&objid_notification.obj_id, obj_id, sizeof(*obj_id)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not obj_id_notifiaction.obj_id = obj_id?
@@ -415,6 +426,9 @@ void send_notifications(event_loop *loop, | |||
send_notifications, plasma_state); | |||
break; | |||
} else { | |||
fprintf(stderr, "send_notifications:send failed with rv=%d, errno=%d, errno=%s\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkm