-
Notifications
You must be signed in to change notification settings - Fork 240
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
[Compression - 5] Add Zstd file compression #220
Conversation
c56697e
to
05a680e
Compare
Signed-off-by: Anas Abou Allaban <allabana@amazon.com>
Signed-off-by: Anas Abou Allaban <allabana@amazon.com>
Signed-off-by: Anas Abou Allaban <allabana@amazon.com>
05a680e
to
50c397e
Compare
Signed-off-by: Anas Abou Allaban <allabana@amazon.com>
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.
See comments
rosbag2_compression/src/rosbag2_compression/zstd_compressor.cpp
Outdated
Show resolved
Hide resolved
rosbag2_compression/src/rosbag2_compression/zstd_compressor.cpp
Outdated
Show resolved
Hide resolved
rosbag2_compression/src/rosbag2_compression/zstd_compressor.cpp
Outdated
Show resolved
Hide resolved
rosbag2_compression/src/rosbag2_compression/zstd_compressor.cpp
Outdated
Show resolved
Hide resolved
rosbag2_compression/src/rosbag2_compression/zstd_compressor.cpp
Outdated
Show resolved
Hide resolved
rosbag2_compression/src/rosbag2_compression/zstd_compressor.cpp
Outdated
Show resolved
Hide resolved
rosbag2_compression/src/rosbag2_compression/zstd_compressor.cpp
Outdated
Show resolved
Hide resolved
rosbag2_compression/test/rosbag2_compression/test_zstd_compressor.cpp
Outdated
Show resolved
Hide resolved
rosbag2_compression/test/rosbag2_compression/test_zstd_compressor.cpp
Outdated
Show resolved
Hide resolved
rosbag2_compression/test/rosbag2_compression/test_zstd_compressor.cpp
Outdated
Show resolved
Hide resolved
rosbag2_compression/src/rosbag2_compression/zstd_compressor.cpp
Outdated
Show resolved
Hide resolved
rosbag2_compression/src/rosbag2_compression/zstd_compressor.cpp
Outdated
Show resolved
Hide resolved
rosbag2_compression/src/rosbag2_compression/zstd_compressor.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Anas Abou Allaban <allabana@amazon.com> Add zstd_vendor, use scopes for files Signed-off-by: Anas Abou Allaban <allabana@amazon.com>
Signed-off-by: Anas Abou Allaban <allabana@amazon.com> Use u_ptr, scope for files, and findlib for zstd Signed-off-by: Anas Abou Allaban <allabana@amazon.com>
Signed-off-by: Anas Abou Allaban <allabana@amazon.com> Wrap file output statement Signed-off-by: Anas Abou Allaban <allabana@amazon.com> Constness Signed-off-by: Anas Abou Allaban <allabana@amazon.com>
68455a2
to
42378f8
Compare
@zmichaels11 @emersonknapp I was unable to go with your suggestions of using a |
@ros2/aws-oncall - please run this CI job |
@piraka9011 to make a buffer using auto buffer = std::make_unique<char[]>(buffer_size); |
Tried that :) In fact, to have support for < C++14, you need: std::make_unique<char[]>(new char[buffer_size], (Custom dtor..) ) See this SO answer and comment on why. |
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.
Just a bunch of nits
rosbag2_compression/src/rosbag2_compression/zstd_compressor.cpp
Outdated
Show resolved
Hide resolved
rosbag2_compression/src/rosbag2_compression/zstd_compressor.cpp
Outdated
Show resolved
Hide resolved
rosbag2_compression/test/rosbag2_compression/test_zstd_compressor.cpp
Outdated
Show resolved
Hide resolved
rosbag2_compression/test/rosbag2_compression/test_zstd_compressor.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Anas Abou Allaban <allabana@amazon.com>
fopen() + std::vector<uint8_t> is what you want IMHO |
Signed-off-by: Anas Abou Allaban <allabana@amazon.com>
@Karsten1987 @thomas-moulard check it out 😃 Vectors and |
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 looks already way better to me
rosbag2_compression/src/rosbag2_compression/zstd_compressor.cpp
Outdated
Show resolved
Hide resolved
rosbag2_compression/src/rosbag2_compression/zstd_compressor.cpp
Outdated
Show resolved
Hide resolved
please make sure to run CI on this. |
Signed-off-by: Anas Abou Allaban <allabana@amazon.com>
a0cf3e7
to
21603a0
Compare
Signed-off-by: Anas Abou Allaban <allabana@amazon.com>
Windows is still unstable since Proposed solution: FILE * get_file_pointer(const std::string & uri, const std::string & read_mode)
{
FILE * fp = nullptr;
#ifdef _WIN32
fopen_s(&fp, uri.c_str(), read_mode.c_str());
#else
fp = fopen(uri.c_str(), read_mode.c_str());
#endif
return fp;
} or simply #ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS 1
#endif |
Your first proposed solution makes sense to me. We apply a similar pattern already in various things in |
Signed-off-by: Zachary Michaels <zmichaels11@gmail.com>
Signed-off-by: Zachary Michaels <zmichaels11@gmail.com>
@Karsten1987 I've applied the suggestions in:
@ros2/aws-oncall Run this CI: #220 (comment) |
rosbag2_compression/src/rosbag2_compression/zstd_compressor.cpp
Outdated
Show resolved
Hide resolved
rosbag2_compression/src/rosbag2_compression/zstd_compressor.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Zachary Michaels <zmichaels11@gmail.com>
Implement file compression for Zstd with tests.
Signed-off-by: Anas Abou Allaban allabana@amazon.com