sstables: determine whether compressed is supported by looking at schema

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
This commit is contained in:
Raphael S. Carvalho
2015-06-11 15:32:46 +03:00
parent 2d9397de58
commit 0c852ec7aa

View File

@@ -18,6 +18,7 @@
#include "types.hh"
#include "sstables.hh"
#include "compress.hh"
#include "unimplemented.hh"
#include <boost/algorithm/string.hpp>
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;