Ability to set different size fanout multipliers for every level.

Summary:
There is an existing field Options.max_bytes_for_level_multiplier that
sets the multiplier for the size of each level in the database.

This patch introduces the ability to set different multipliers
for every level in the database. The size of a level is determined
by using both max_bytes_for_level_multiplier as well as the
per-level fanout.

size of level[i] = size of level[i-1] * max_bytes_for_level_multiplier
                   * fanout[i-1]

The default value of fanout is 1, so that it is backward compatible.

Test Plan: make check

Reviewers: haobo, emayanke

Reviewed By: emayanke

CC: leveldb

Differential Revision: https://reviews.facebook.net/D10863
This commit is contained in:
Dhruba Borthakur
2013-05-21 11:37:06 -07:00
parent c3c13db346
commit d1aaaf718c
8 changed files with 72 additions and 11 deletions

12
util/string_util.h Normal file
View File

@@ -0,0 +1,12 @@
// Copyright (c) 2013 Facebook.
#ifndef STORAGE_LEVELDB_UTIL_STRINGUTIL_H_
#define STORAGE_LEVELDB_UTIL_STRINGUTIL_H_
namespace leveldb {
extern std::vector<std::string> stringSplit(std::string arg, char delim);
}
#endif // STORAGE_LEVELDB_UTIL_STRINGUTIL_H_