Don't compress block bigger than 2GB

Summary: This is a temporary solution to a issue that we have with compression libraries. See task #4453446.

Test Plan: make check doesn't complain :)

Reviewers: haobo, ljin, yhchiang, dhruba, sdong

Reviewed By: sdong

Subscribers: leveldb

Differential Revision: https://reviews.facebook.net/D18975
This commit is contained in:
Igor Canadi
2014-06-09 12:26:09 -07:00
parent ee5a51e6ce
commit f43c8262c2
3 changed files with 17 additions and 3 deletions

View File

@@ -9,6 +9,7 @@
#pragma once
#include <stdint.h>
#include <limits>
#include "rocksdb/flush_block_policy.h"
#include "rocksdb/options.h"
@@ -84,6 +85,10 @@ class BlockBasedTableBuilder : public TableBuilder {
// REQUIRES: Finish(), Abandon() have not been called
void Flush();
// Some compression libraries fail when the raw size is bigger than int. If
// uncompressed size is bigger than kCompressionSizeLimit, don't compress it
const uint64_t kCompressionSizeLimit = std::numeric_limits<int>::max();
// No copying allowed
BlockBasedTableBuilder(const BlockBasedTableBuilder&) = delete;
void operator=(const BlockBasedTableBuilder&) = delete;