Fix typo in comments and code (#10233)

Summary:
Fix typo in comments and code.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/10233

Test Plan: Existing unit tests should pass.

Reviewed By: jay-zhuang, anand1976

Differential Revision: D37356702

Pulled By: gitbw95

fbshipit-source-id: 32c019adcc6dcc95a9882b38147a310091368e51
This commit is contained in:
Bo Wang 2022-06-22 15:45:21 -07:00 committed by Facebook GitHub Bot
parent e103b87296
commit c073ed7601
14 changed files with 21 additions and 24 deletions

View File

@ -480,11 +480,8 @@ class ColumnFamilyData {
const MutableCFOptions& mutable_cf_options,
const ImmutableCFOptions& immutable_cf_options);
// Recalculate some small conditions, which are changed only during
// compaction, adding new memtable and/or
// recalculation of compaction score. These values are used in
// DBImpl::MakeRoomForWrite function to decide, if it need to make
// a write stall
// Recalculate some stall conditions, which are changed only during
// compaction, adding new memtable and/or recalculation of compaction score.
WriteStallCondition RecalculateWriteStallConditions(
const MutableCFOptions& mutable_cf_options);

View File

@ -2237,7 +2237,7 @@ Status DBImpl::AtomicFlushMemTables(
// This method tries to avoid write stall (similar to CompactRange() behavior)
// it emulates how the SuperVersion / LSM would change if flush happens, checks
// it against various constrains and delays flush if it'd cause write stall.
// Called should check status and flush_needed to see if flush already happened.
// Caller should check status and flush_needed to see if flush already happened.
Status DBImpl::WaitUntilFlushWouldNotStallWrites(ColumnFamilyData* cfd,
bool* flush_needed) {
{

View File

@ -453,7 +453,7 @@ TEST_F(DBOptionsTest, WritableFileMaxBufferSize) {
dbfull()->SetDBOptions({{"writable_file_max_buffer_size", "524288"}}));
buffer_size = 512 * 1024;
match_cnt = 0;
unmatch_cnt = 0; // SetDBOptions() will create a WriteableFileWriter
unmatch_cnt = 0; // SetDBOptions() will create a WritableFileWriter
ASSERT_EQ(buffer_size,
dbfull()->GetDBOptions().writable_file_max_buffer_size);

View File

@ -28,7 +28,7 @@ namespace log {
/**
* Writer is a general purpose log stream writer. It provides an append-only
* abstraction for writing data. The details of the how the data is written is
* handled by the WriteableFile sub-class implementation.
* handled by the WritableFile sub-class implementation.
*
* File format:
*

View File

@ -316,7 +316,7 @@ struct FileMetaData {
};
// A compressed copy of file meta data that just contain minimum data needed
// to server read operations, while still keeping the pointer to full metadata
// to serve read operations, while still keeping the pointer to full metadata
// of the file in case it is needed.
struct FdWithKeyRange {
FileDescriptor fd;

4
env/env_test.cc vendored
View File

@ -1980,7 +1980,7 @@ TEST_P(EnvPosixTestWithParam, PosixRandomRWFile) {
// Cannot open non-existing file.
ASSERT_NOK(env_->NewRandomRWFile(path, &file, EnvOptions()));
// Create the file using WriteableFile
// Create the file using WritableFile
{
std::unique_ptr<WritableFile> wf;
ASSERT_OK(env_->NewWritableFile(path, &wf, EnvOptions()));
@ -2109,7 +2109,7 @@ TEST_P(EnvPosixTestWithParam, PosixRandomRWFileRandomized) {
ASSERT_NOK(env_->NewRandomRWFile(path, &file, EnvOptions()));
#endif
// Create the file using WriteableFile
// Create the file using WritableFile
{
std::unique_ptr<WritableFile> wf;
ASSERT_OK(env_->NewWritableFile(path, &wf, EnvOptions()));

View File

@ -38,7 +38,7 @@ FSReadRequest Align(const FSReadRequest& r, size_t alignment);
// Otherwise, do nothing and return false.
bool TryMerge(FSReadRequest* dest, const FSReadRequest& src);
// RandomAccessFileReader is a wrapper on top of Env::RandomAccessFile. It is
// RandomAccessFileReader is a wrapper on top of FSRandomAccessFile. It is
// responsible for:
// - Handling Buffered and Direct reads appropriately.
// - Rate limiting compaction reads.

View File

@ -876,7 +876,7 @@ class WritableFile {
virtual ~WritableFile();
// Append data to the end of the file
// Note: A WriteableFile object must support either Append or
// Note: A WritableFile object must support either Append or
// PositionedAppend, so the users cannot mix the two.
virtual Status Append(const Slice& data) = 0;

View File

@ -951,7 +951,7 @@ class FSWritableFile {
virtual ~FSWritableFile() {}
// Append data to the end of the file
// Note: A WriteableFile object must support either Append or
// Note: A WritableFile object must support either Append or
// PositionedAppend, so the users cannot mix the two.
virtual IOStatus Append(const Slice& data, const IOOptions& options,
IODebugContext* dbg) = 0;

View File

@ -410,7 +410,7 @@ IOStatus WinFileSystem::OpenWritableFile(
if (INVALID_HANDLE_VALUE == hFile) {
auto lastError = GetLastError();
return IOErrorFromWindowsError(
"Failed to create a NewWriteableFile: " + fname, lastError);
"Failed to create a NewWritableFile: " + fname, lastError);
}
// We will start writing at the end, appending

View File

@ -387,7 +387,7 @@ static std::unordered_map<std::string, OptionTypeInfo>
{offsetof(struct BlockBasedTableOptions, block_cache),
OptionType::kUnknown, OptionVerificationType::kNormal,
(OptionTypeFlags::kCompareNever | OptionTypeFlags::kDontSerialize),
// Parses the input vsalue as a Cache
// Parses the input value as a Cache
[](const ConfigOptions& opts, const std::string&,
const std::string& value, void* addr) {
auto* cache = static_cast<std::shared_ptr<Cache>*>(addr);
@ -397,7 +397,7 @@ static std::unordered_map<std::string, OptionTypeInfo>
{offsetof(struct BlockBasedTableOptions, block_cache_compressed),
OptionType::kUnknown, OptionVerificationType::kNormal,
(OptionTypeFlags::kCompareNever | OptionTypeFlags::kDontSerialize),
// Parses the input vsalue as a Cache
// Parses the input value as a Cache
[](const ConfigOptions& opts, const std::string&,
const std::string& value, void* addr) {
auto* cache = static_cast<std::shared_ptr<Cache>*>(addr);

View File

@ -126,7 +126,7 @@ inline void BlockFetcher::PrepareBufferForBlockFromFile() {
// cache miss read from device
if ((do_uncompress_ || ioptions_.allow_mmap_reads) &&
block_size_with_trailer_ < kDefaultStackBufferSize) {
// If we've got a small enough hunk of data, read it in to the
// If we've got a small enough chunk of data, read it in to the
// trivially allocated stack buffer instead of needing a full malloc()
//
// `GetBlockContents()` cannot return this data as its lifetime is tied to

View File

@ -1246,7 +1246,7 @@ class FileChecksumTestHelper {
}
~FileChecksumTestHelper() {}
void CreateWriteableFile() {
void CreateWritableFile() {
sink_ = new test::StringSink();
std::unique_ptr<FSWritableFile> holder(sink_);
file_writer_.reset(new WritableFileWriter(
@ -3739,7 +3739,7 @@ TEST_P(BlockBasedTableTest, NoFileChecksum) {
std::string column_family_name;
FileChecksumTestHelper f(true);
f.CreateWriteableFile();
f.CreateWritableFile();
std::unique_ptr<TableBuilder> builder;
builder.reset(ioptions.table_factory->NewTableBuilder(
TableBuilderOptions(ioptions, moptions, *comparator,
@ -3774,7 +3774,7 @@ TEST_P(BlockBasedTableTest, Crc32cFileChecksum) {
options.file_checksum_gen_factory->CreateFileChecksumGenerator(
gen_context);
FileChecksumTestHelper f(true);
f.CreateWriteableFile();
f.CreateWritableFile();
f.SetFileChecksumGenerator(checksum_crc32c_gen1.release());
std::unique_ptr<TableBuilder> builder;
builder.reset(ioptions.table_factory->NewTableBuilder(
@ -3876,7 +3876,7 @@ TEST_F(PlainTableTest, NoFileChecksum) {
std::string column_family_name;
int unknown_level = -1;
FileChecksumTestHelper f(true);
f.CreateWriteableFile();
f.CreateWritableFile();
std::unique_ptr<TableBuilder> builder(factory.NewTableBuilder(
TableBuilderOptions(ioptions, moptions, ikc,
@ -3915,7 +3915,7 @@ TEST_F(PlainTableTest, Crc32cFileChecksum) {
options.file_checksum_gen_factory->CreateFileChecksumGenerator(
gen_context);
FileChecksumTestHelper f(true);
f.CreateWriteableFile();
f.CreateWritableFile();
f.SetFileChecksumGenerator(checksum_crc32c_gen1.release());
std::unique_ptr<TableBuilder> builder(factory.NewTableBuilder(

View File

@ -43,7 +43,7 @@ class MutexLock {
//
// Acquire a ReadLock on the specified RWMutex.
// The Lock will be automatically released then the
// The Lock will be automatically released when the
// object goes out of scope.
//
class ReadLock {