Make Copier and Encoder support writing partial messages
Along with changes to DummyEncoder, this gets us nicely setup to create
nice round buffer sizes for both DummyEncoder and LzmaEncoder. Those
can be written using O_DIRECT in a follow on commit for much more
efficient IO.
To do this, we need to introduce both start and stop bytes to Copier,
and then teach Encoder how to return what it was able to encode, and
then to restart part way through a message.
--flush_size now sets the buffer size.
Change-Id: I7a26d2ce677a28bd0e73333514302dc0612195c2
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/events/logging/log_namer.h b/aos/events/logging/log_namer.h
index 4e8c990..07edeac 100644
--- a/aos/events/logging/log_namer.h
+++ b/aos/events/logging/log_namer.h
@@ -491,10 +491,7 @@
std::vector<std::string> all_filenames_;
std::string temp_suffix_;
- std::function<std::unique_ptr<DataEncoder>(size_t)> encoder_factory_ =
- [](size_t max_message_size) {
- return std::make_unique<DummyEncoder>(max_message_size);
- };
+ std::function<std::unique_ptr<DataEncoder>(size_t)> encoder_factory_;
std::string extension_;
// Storage for statistics from previously-rotated DetachedBufferWriters.