-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Second Part of Internal API Refactor #1326
Conversation
Merged build finished. Test FAILed. |
Test FAILed. |
Build finished. Test PASSed. |
Test PASSed. |
Build finished. Test PASSed. |
Test PASSed. |
Build finished. Test PASSed. |
Test PASSed. |
Build finished. Test FAILed. |
Test FAILed. |
Build finished. Test FAILed. |
Test FAILed. |
Build finished. Test PASSed. |
Test PASSed. |
Merged build finished. Test PASSed. |
Test PASSed. |
Merged build finished. Test PASSed. |
Test PASSed. |
Merged build finished. Test PASSed. |
Test PASSed. |
Merged build finished. Test PASSed. |
Test PASSed. |
Merged build finished. Test PASSed. |
Test PASSed. |
Merged build finished. Test PASSed. |
Test PASSed. |
Merged build finished. Test FAILed. |
Test FAILed. |
Merged build finished. Test FAILed. |
Merged build finished. Test PASSed. |
Test PASSed. |
Merged build finished. Test FAILed. |
Test FAILed. |
Merged build finished. Test PASSed. |
Test PASSed. |
Merged build finished. Test PASSed. |
Test PASSed. |
Merged build finished. Test PASSed. |
Test PASSed. |
Merged build finished. Test PASSed. |
Test PASSed. |
Merged build finished. Test PASSed. |
Test PASSed. |
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.
Great work here, this is way cleaner than before!
* @return True if the worker IDs are the same and false otherwise. | ||
*/ | ||
bool WorkerID_equal(WorkerID first_id, WorkerID second_id); | ||
typedef ray::UniqueID WorkerID; |
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.
Isn't this already defined in id.h
?
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.
fixed
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.
actually, in id.h we have ray::WorkerID and ray::DBClientID; as most of the GCS code will get removed, I'm just going to keep this for now.
* @return True if the db client ID is equal to nil. | ||
*/ | ||
bool DBClientID_is_nil(ObjectID id); | ||
typedef ray::UniqueID DBClientID; |
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.
Isn't this already defined in id.h
?
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.
fixed
@@ -79,7 +79,7 @@ void RayLogger_log(RayLogger *logger, | |||
|
|||
int status = | |||
redisAsyncCommand(context, NULL, NULL, formatted_message, | |||
(char *) db->client.id, sizeof(db->client.id)); | |||
(char *) db->client.data(), sizeof(db->client)); |
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.
we should be using C++ style casts everywhere (at least for new code)
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.
let's do this incrementally
@@ -672,7 +673,8 @@ void redis_object_table_lookup_callback(redisAsyncContext *c, | |||
for (size_t j = 0; j < reply->elements; ++j) { | |||
CHECK(reply->element[j]->type == REDIS_REPLY_STRING); | |||
DBClientID manager_id; | |||
memcpy(manager_id.id, reply->element[j]->str, sizeof(manager_id.id)); | |||
memcpy(manager_id.mutable_data(), reply->element[j]->str, |
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.
We have a decent number of memcpy
's in the codebase. Maybe this functionality should be part of the ObjectID
class.
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.
This code will go away as soon as the new GCS client code will be merged, and the rest should be modernized piece by piece.
@@ -145,23 +145,23 @@ void free_task_builder(TaskBuilder *builder) { | |||
} | |||
|
|||
bool TaskID_equal(TaskID first_id, TaskID second_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.
The plan is for these equal
and is_nil
methods to go away (e.g., in a future PR) and just use ==
and is_nil
, right?
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.
Yeah!
ARROW_UNUSED(id_string); | ||
std::string id_string = client_id.hex(); | ||
LOG_DEBUG("Local scheduler heartbeat from db_client_id %s", | ||
id_string.c_str()); |
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.
What's the plan for these logging macros down the road? E.g., Arrow uses something more compatible with C++ style logging, which would be nice here so we could avoid the .c_str
and not have to worry so much about string formatting.
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.
Yeah, the code is already in ray/util/logging.h and the various components should be modernized as we go along.
@@ -59,7 +59,7 @@ void PlasmaManagerState_free(PlasmaManagerState *state); | |||
* manager. | |||
*/ | |||
void process_transfer(event_loop *loop, | |||
ObjectID object_id, | |||
ray::ObjectID object_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.
not super critical, but all of the ray::ObjectID object_id
in this file should be const ray::ObjectID &object_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.
Yeah, let's do this incrementally!
src/ray/id.cc
Outdated
const uint8_t *data = rhs.data(); | ||
while (--i > 0 && data[i] == 255) { | ||
const uint8_t *d = data(); | ||
while (--i > 0 && d[i] == 255) { |
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.
I might be misreading this, but doesn't this fail to check d[0]
? Also, we don't have any guarantees about the order in which the two boolean clauses are executed, right? But if they are executed out of order then we will have problems.
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.
Good catch!
Merged build finished. Test FAILed. |
Test FAILed. |
Merged build finished. Test PASSed. |
Test PASSed. |
This PR switches the old object IDs with the new ones as a preparation for integrating the GCS APIs.