Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

Yeolar
Copy link
Contributor

@Yeolar Yeolar commented Jul 25, 2017

Related to #878, add DCHECK for ReadXXX.

@pcmoritz
Copy link
Contributor

@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,
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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) {
Copy link
Member

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

Copy link
Contributor Author

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.

@pcmoritz
Copy link
Contributor

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

Copy link
Member

@wesm wesm left a 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!

@asfgit asfgit closed this in 676a4a9 Jul 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants