From 0c852ec7aab8bd23db26a6a478f630575628f4e2 Mon Sep 17 00:00:00 2001 From: "Raphael S. Carvalho" Date: Thu, 11 Jun 2015 15:32:46 +0300 Subject: [PATCH] sstables: determine whether compressed is supported by looking at schema Signed-off-by: Raphael S. Carvalho Reviewed-by: Nadav Har'El --- sstables/sstables.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sstables/sstables.cc b/sstables/sstables.cc index 8bddce7f89..6a3fedb5a1 100644 --- a/sstables/sstables.cc +++ b/sstables/sstables.cc @@ -18,6 +18,7 @@ #include "types.hh" #include "sstables.hh" #include "compress.hh" +#include "unimplemented.hh" #include namespace sstables { @@ -1155,10 +1156,12 @@ static void add_stats_metadata(statistics& s, metadata_collector& collector) { } void sstable::do_write_components(const memtable& mt) { - bool checksum_file = true; - // FIXME: CRC component must only be present when compression isn't enabled. + // CRC component must only be present when compression isn't enabled. + bool checksum_file = mt.schema()->get_compressor() == compressor::none; if (checksum_file) { _components.insert(component_type::CRC); + } else { + fail(unimplemented::cause::COMPRESSION); } constexpr size_t sstable_buffer_size = 64*1024;