From bfc737da2179ec0a1b0cc1d01e1ceea69518813e Mon Sep 17 00:00:00 2001 From: Yu Zhao 00540916 Date: Fri, 22 Jul 2022 19:25:52 -0700 Subject: [PATCH] fix typos in some code and comment (#10139) Summary: Minor issue, I just found a few typos on db_test and column_family while reading the code. And I have this PR opened to contribute. :) Pull Request resolved: https://github.com/facebook/rocksdb/pull/10139 Reviewed By: ajkr Differential Revision: D38007098 Pulled By: jay-zhuang fbshipit-source-id: 511947b32424c34348184691216640f32c410fb1 --- db/column_family.cc | 4 ++-- db/column_family_test.cc | 2 +- db/db_test.cc | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/db/column_family.cc b/db/column_family.cc index 2c93eed2c..fe416db9b 100644 --- a/db/column_family.cc +++ b/db/column_family.cc @@ -786,13 +786,13 @@ namespace { std::unique_ptr SetupDelay( WriteController* write_controller, uint64_t compaction_needed_bytes, uint64_t prev_compaction_need_bytes, bool penalize_stop, - bool auto_comapctions_disabled) { + bool auto_compactions_disabled) { const uint64_t kMinWriteRate = 16 * 1024u; // Minimum write rate 16KB/s. uint64_t max_write_rate = write_controller->max_delayed_write_rate(); uint64_t write_rate = write_controller->delayed_write_rate(); - if (auto_comapctions_disabled) { + if (auto_compactions_disabled) { // When auto compaction is disabled, always use the value user gave. write_rate = max_write_rate; } else if (write_controller->NeedsDelay() && max_write_rate > kMinWriteRate) { diff --git a/db/column_family_test.cc b/db/column_family_test.cc index 20e6baa97..518a5db9f 100644 --- a/db/column_family_test.cc +++ b/db/column_family_test.cc @@ -1116,7 +1116,7 @@ TEST_P(ColumnFamilyTest, DifferentWriteBufferSizes) { CreateColumnFamilies({"one", "two", "three"}); ColumnFamilyOptions default_cf, one, two, three; // setup options. all column families have max_write_buffer_number setup to 10 - // "default" -> 100KB memtable, start flushing immediatelly + // "default" -> 100KB memtable, start flushing immediately // "one" -> 200KB memtable, start flushing with two immutable memtables // "two" -> 1MB memtable, start flushing with three immutable memtables // "three" -> 90KB memtable, start flushing with four immutable memtables diff --git a/db/db_test.cc b/db/db_test.cc index 9defb81d0..df0f9ab8c 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -492,7 +492,7 @@ TEST_F(DBTest, PutSingleDeleteGet) { ASSERT_EQ("v2", Get(1, "foo2")); ASSERT_OK(SingleDelete(1, "foo")); ASSERT_EQ("NOT_FOUND", Get(1, "foo")); - // Skip FIFO and universal compaction beccause they do not apply to the test + // Skip FIFO and universal compaction because they do not apply to the test // case. Skip MergePut because single delete does not get removed when it // encounters a merge. } while (ChangeOptions(kSkipFIFOCompaction | kSkipUniversalCompaction | @@ -645,7 +645,7 @@ TEST_F(DBTest, SingleDeleteFlush) { ASSERT_EQ("NOT_FOUND", Get(1, "bar")); ASSERT_EQ("NOT_FOUND", Get(1, "foo")); - // Skip FIFO and universal compaction beccause they do not apply to the test + // Skip FIFO and universal compaction beccaus they do not apply to the test // case. Skip MergePut because single delete does not get removed when it // encounters a merge. } while (ChangeOptions(kSkipFIFOCompaction | kSkipUniversalCompaction | @@ -668,7 +668,7 @@ TEST_F(DBTest, SingleDeletePutFlush) { ASSERT_OK(Flush(1)); ASSERT_EQ("[ ]", AllEntriesFor("a", 1)); - // Skip FIFO and universal compaction beccause they do not apply to the test + // Skip FIFO and universal compaction beccaus they do not apply to the test // case. Skip MergePut because single delete does not get removed when it // encounters a merge. } while (ChangeOptions(kSkipFIFOCompaction | kSkipUniversalCompaction | @@ -1993,7 +1993,7 @@ TEST_F(DBTest, UnremovableSingleDelete) { ASSERT_EQ("first", Get(1, "foo", snapshot)); ASSERT_EQ("NOT_FOUND", Get(1, "foo")); db_->ReleaseSnapshot(snapshot); - // Skip FIFO and universal compaction beccause they do not apply to the test + // Skip FIFO and universal compaction because they do not apply to the test // case. Skip MergePut because single delete does not get removed when it // encounters a merge. } while (ChangeOptions(kSkipFIFOCompaction | kSkipUniversalCompaction |