Add the correct table_factory for tables in table_tests

main
Kai Liu 11 years ago
parent 88ba331c1a
commit 80bb81c6fe
  1. 8
      table/table_test.cc
  2. 1
      util/options.cc

@ -543,6 +543,7 @@ class Harness {
// Use shorter block size for tests to exercise block boundary
// conditions more.
options_.block_size = 256;
options_.SetUpDefaultFlushBlockPolicyFactory();
if (args.reverse_compare) {
options_.comparator = &reverse_key_comparator;
}
@ -909,6 +910,8 @@ TEST(TableTest, NumBlockStat) {
options.compression = kNoCompression;
options.block_restart_interval = 1;
options.block_size = 1000;
options.SetUpDefaultFlushBlockPolicyFactory();
// Block Size changed, need to set up a new flush policy to reflect the
// change.
options.SetUpDefaultFlushBlockPolicyFactory();
@ -976,7 +979,7 @@ class BlockCacheStats {
TEST(TableTest, BlockCacheTest) {
// -- Table construction
Options options;
Options options = GetDefaultOptions();
options.create_if_missing = true;
options.statistics = CreateDBStatistics();
options.block_cache = NewLRUCache(1024);
@ -1116,6 +1119,7 @@ TEST(TableTest, ApproximateOffsetOfPlain) {
KVMap kvmap;
Options options = GetDefaultOptions();
options.block_size = 1024;
options.SetUpDefaultFlushBlockPolicyFactory();
options.compression = kNoCompression;
c.Finish(options, &keys, &kvmap);
@ -1145,6 +1149,7 @@ static void Do_Compression_Test(CompressionType comp) {
KVMap kvmap;
Options options = GetDefaultOptions();
options.block_size = 1024;
options.SetUpDefaultFlushBlockPolicyFactory();
options.compression = comp;
c.Finish(options, &keys, &kvmap);
@ -1187,6 +1192,7 @@ TEST(TableTest, BlockCacheLeak) {
Options opt = GetDefaultOptions();
opt.block_size = 1024;
opt.SetUpDefaultFlushBlockPolicyFactory();
opt.compression = kNoCompression;
opt.block_cache = NewLRUCache(16*1024*1024); // big enough so we don't ever
// lose cached values.

@ -332,7 +332,6 @@ Options::PrepareForBulkLoad()
}
Options* Options::SetUpDefaultFlushBlockPolicyFactory() {
assert(!flush_block_policy_factory);
flush_block_policy_factory =
std::make_shared<FlushBlockBySizePolicyFactory>(
block_size, block_size_deviation);

Loading…
Cancel
Save