Enable snappy compression in logger
In doing so, increase the parameterization of logger_test a bit, so up
the shard count.
Change-Id: I9d8d571b4eccc56266c9ba839783f3df9f9c36ab
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/aos/events/logging/logfile_utils.cc b/aos/events/logging/logfile_utils.cc
index dd82418..9c8b7af 100644
--- a/aos/events/logging/logfile_utils.cc
+++ b/aos/events/logging/logfile_utils.cc
@@ -10,6 +10,7 @@
#include "absl/strings/escaping.h"
#include "aos/configuration.h"
+#include "aos/events/logging/snappy_encoder.h"
#include "aos/flatbuffer_merge.h"
#include "aos/util/file.h"
#include "flatbuffers/flatbuffers.h"
@@ -332,12 +333,15 @@
decoder_ = std::make_unique<DummyDecoder>(filename);
static constexpr std::string_view kXz = ".xz";
+ static constexpr std::string_view kSnappy = SnappyDecoder::kExtension;
if (filename.substr(filename.size() - kXz.size()) == kXz) {
#if ENABLE_LZMA
decoder_ = std::make_unique<ThreadedLzmaDecoder>(std::move(decoder_));
#else
LOG(FATAL) << "Reading xz-compressed files not supported on this platform";
#endif
+ } else if (filename.substr(filename.size() - kSnappy.size()) == kSnappy) {
+ decoder_ = std::make_unique<SnappyDecoder>(std::move(decoder_));
}
}