| 40 | } |
| 41 | |
| 42 | static double MaxBytesForLevel(const Options* options, int level) { |
| 43 | // Note: the result for level zero is not really used since we set |
| 44 | // the level-0 compaction threshold based on number of files. |
| 45 | |
| 46 | // Result for both level-0 and level-1 |
| 47 | double result = 10. * 1048576.0; |
| 48 | while (level > 1) { |
| 49 | result *= 10; |
| 50 | level--; |
| 51 | } |
| 52 | return result; |
| 53 | } |
| 54 | |
| 55 | static uint64_t MaxFileSizeForLevel(const Options* options, int level) { |
| 56 | // We could vary per level to reduce number of files? |