Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -564,9 +564,9 @@ struct Config {
// Note: this value shall be less than the corresponding trigger threshold.
uint32_t mergeSelectDataFileDeadByteThreshold = 12'800'000;

// 'mergeSelectDataFileSmallSizeTheshold' describes the minimum size below which a file is included in the merge.
// 'mergeSelectDataFileSmallSizeThreshold' describes the minimum size below which a file is included in the merge.
// The purpose is to reduce the quantity of small data files to keep open file quantity low.
uint32_t mergeSelectDataFileSmallSizeTheshold = 10'000'000;
uint32_t mergeSelectDataFileSmallSizeThreshold = 10'000'000;
};

```
Expand Down
12 changes: 6 additions & 6 deletions lib/litecask.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,9 @@ struct Config {
// in a file to cause it to be included in the merge.
// Note: this value shall be equal or less than the corresponding trigger threshold.
uint32_t mergeSelectDataFileDeadByteThreshold = 10'000'000;
// 'mergeSelectDataFileSmallSizeTheshold' describes the minimum size below which a file is included in the merge.
// 'mergeSelectDataFileSmallSizeThreshold' describes the minimum size below which a file is included in the merge.
// The purpose is to reduce the quantity of small data files to keep open file quantity low.
uint32_t mergeSelectDataFileSmallSizeTheshold = 10'000'000;
uint32_t mergeSelectDataFileSmallSizeThreshold = 10'000'000;
};

enum class LogLevel { Debug = 0, Info = 1, Warn = 2, Error = 3, Fatal = 4, None = 5 };
Expand Down Expand Up @@ -2967,8 +2967,8 @@ class Datastore // NOLINT(clang-analyzer-optin.performance.Padding) Padding is
config.mergeTriggerDataFileDeadByteThreshold);
return Status::InconsistentParameterValues;
}
if (config.mergeSelectDataFileSmallSizeTheshold < detail::MinDataFileMaxBytes) {
log(LogLevel::Warn, "setConfig: too small 'mergeSelectDataFileSmallSizeTheshold' parameter value. Shall be above %d",
if (config.mergeSelectDataFileSmallSizeThreshold < detail::MinDataFileMaxBytes) {
log(LogLevel::Warn, "setConfig: too small 'mergeSelectDataFileSmallSizeThreshold' parameter value. Shall be above %d",
detail::MinDataFileMaxBytes);
return Status::BadParameterValue;
}
Expand Down Expand Up @@ -4382,7 +4382,7 @@ class Datastore // NOLINT(clang-analyzer-optin.performance.Padding) Padding is
lcVector<MergeFileInfo> mergeInfos;
if (isItWorthMerging(c.mergeTriggerDataFileFragmentationPercentage, c.mergeTriggerDataFileDeadByteThreshold)) {
selectDataFilesToMerge(c.mergeSelectDataFileFragmentationPercentage, c.mergeSelectDataFileDeadByteThreshold,
c.mergeSelectDataFileSmallSizeTheshold, mergeInfos);
c.mergeSelectDataFileSmallSizeThreshold, mergeInfos);
}

if (!mergeInfos.empty()) {
Expand Down Expand Up @@ -4782,7 +4782,7 @@ class Datastore // NOLINT(clang-analyzer-optin.performance.Padding) Padding is
// The default handler is displaying on console with a relative date
void defaultLogHandler(LogLevel level, const char* message, bool closeDbNotification) const
{
constexpr const char* levelStr[5] = {"[debug]", "[info ]", "[warn ]", "[error]", "[FATAL]"};
constexpr const char* levelStr[5] = {"[debug]", "[info]", "[warn]", "[error]", "[FATAL]"};
static FILE* fileHandle = nullptr;

// Log file management
Expand Down
8 changes: 4 additions & 4 deletions lib/ut/test_basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ TEST_SUITE("Basic")
c.mergeTriggerDataFileDeadByteThreshold = 10'000;
c.mergeSelectDataFileFragmentationPercentage = 1;
c.mergeSelectDataFileDeadByteThreshold = 9000;
c.mergeSelectDataFileSmallSizeTheshold = 8000;
c.mergeSelectDataFileSmallSizeThreshold = 8000;
s = store.setConfig(c);
CHECK_EQ(s, Status::Ok);

Expand All @@ -109,7 +109,7 @@ TEST_SUITE("Basic")
CHECK_BAD_PARAM_VALUE(mergeSelectDataFileFragmentationPercentage, 101, BadParameterValue);
CHECK_BAD_PARAM_VALUE(mergeSelectDataFileFragmentationPercentage, 3, InconsistentParameterValues);
CHECK_BAD_PARAM_VALUE(mergeSelectDataFileDeadByteThreshold, 10001, InconsistentParameterValues);
CHECK_BAD_PARAM_VALUE(mergeSelectDataFileSmallSizeTheshold, 1023, BadParameterValue);
CHECK_BAD_PARAM_VALUE(mergeSelectDataFileSmallSizeThreshold, 1023, BadParameterValue);
}

TEST_CASE("1-Sanity : LockFile DB protection against multiple opening")
Expand Down Expand Up @@ -234,7 +234,7 @@ TEST_SUITE("Basic")
c.mergeTriggerDataFileDeadByteThreshold = 1024;
c.mergeSelectDataFileFragmentationPercentage = 40;
c.mergeSelectDataFileDeadByteThreshold = 1024;
c.mergeSelectDataFileSmallSizeTheshold = 1024;
c.mergeSelectDataFileSmallSizeThreshold = 1024;
s = store.setConfig(c);
CHECK_EQ(s, Status::Ok);

Expand Down Expand Up @@ -480,7 +480,7 @@ TEST_SUITE("Basic")
c.mergeTriggerDataFileDeadByteThreshold = 10'000;
c.mergeSelectDataFileFragmentationPercentage = 1;
c.mergeSelectDataFileDeadByteThreshold = 9000;
c.mergeSelectDataFileSmallSizeTheshold = 8000;
c.mergeSelectDataFileSmallSizeThreshold = 8000;
s = store.setConfig(c);
CHECK_EQ(s, Status::Ok);

Expand Down