-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
ARROW-1255: [Plasma] Fix typo in plasma protocol; add DCHECK for ReadXXX in plasma protocol. #887
Conversation
@Yeolar Looks good to me! Can you also fix the remaining Travis failure please? |
@@ -62,10 +62,11 @@ Status SendCreateRequest(int sock, ObjectID object_id, int64_t data_size, | |||
return PlasmaSend(sock, MessageType_PlasmaCreateRequest, &fbb, message); | |||
} | |||
|
|||
Status ReadCreateRequest(uint8_t* data, ObjectID* object_id, int64_t* data_size, | |||
int64_t* metadata_size) { | |||
Status ReadCreateRequest(uint8_t* data, size_t size, 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.
You probably want int64_t
here for the size
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.
ok, I'll check it.
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 use int64_t for size type? The ReadXXX was called with parameter from std::vector<>, then the size is size_t type correspondingly. I see mostly using int64_t for size in the project, the reason is?
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.
Sorry, I thought these were arrow::Buffer
objects. @pcmoritz have you considered moving all your heap allocations to an Arrow memory pool?
We prefer to use signed integer types unless we are dealing with system calls (like malloc) or the STL, basically following Google's guidance on this https://google.github.io/styleguide/cppguide.html#Integer_Types
I think it's fine to leave this as is and we can refactor later.
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.
OK, got it, thanks.
@@ -28,6 +28,12 @@ namespace plasma { | |||
|
|||
using arrow::Status; | |||
|
|||
template <class T> | |||
bool verify_flatbuffer(T* object, uint8_t* data, size_t size) { |
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.
If you receive int64_t size
here, then you only have to static cast to size_t
in one place when you create the verifier
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.
emm, it seems int64_t is used for size type in the project, I'll have a look.
There are some linting fixes left to be done, you can get a proposal for fixes by running 'make format' as described in https://github.com/apache/arrow/blob/1a72acdf4daa68fe6e7639acde08a0abf795a3fc/cpp/README.md I'd propose we merge this with size_t and move the heap allocations to an Arrow memory pool as a followup PR, I created a JIRA here: https://issues.apache.org/jira/browse/ARROW-1266 |
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.
+1. Thank you for the contribution!
Related to #878, add DCHECK for ReadXXX.