-
Notifications
You must be signed in to change notification settings - Fork 24
Enable putting bytes into the database via C++ and Python #521
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #521 +/- ##
============================================
- Coverage 95.92% 57.58% -38.34%
============================================
Files 10 147 +137
Lines 884 11907 +11023
Branches 0 1138 +1138
============================================
+ Hits 848 6857 +6009
- Misses 36 4899 +4863
- Partials 0 151 +151
|
returns new, unmanaged memory.
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.
Nicely done! One suggestion with regard to the unpack_bytes
method in the C++ client
|
||
// Get byte data and fill an already allocated array | ||
// memory space that has the specified size. | ||
void Client::unpack_bytes(const std::string& name, |
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.
Currently this requires that the buffer and the reply from Redis are exactly the same size. This might be a little overly restrictive especially because the size of the byte string may not be known a priori. I'd suggest that we change this:
void Client::unpack_bytes(const std::string& name,
void* data,
const size_t n_buffer_size,
size_t* obj_size
)
The check internally should then be that the buffer size is >=
to the message reply
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.
Looks good. Thanks!
This PR adds the ability to put raw byte strings into the database. This PR covers the C++ and Python clients and Fortran and C clients will be addressed in a follow-up PR.