Fix spelling in public API (#9490)

Summary:
I feel it would be nice if we can fix this spelling error.

In `SizeApproximationOptions`, the `include_memtabtles` should be `include_memtables`.

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

Test Plan: make check

Reviewed By: hx235

Differential Revision: D33949862

Pulled By: riversand963

fbshipit-source-id: b2be67501b65d4aabb6b8df1bf25eb8d54cc1466
main
Yanqin Jin 3 years ago committed by Facebook GitHub Bot
parent aae3093719
commit 629e3e1d77
  1. 1
      HISTORY.md
  2. 4
      db/db_impl/db_impl.cc
  3. 8
      db/db_test.cc
  4. 2
      db/db_with_timestamp_basic_test.cc
  5. 4
      db_stress_tool/db_stress_test_base.cc
  6. 2
      include/rocksdb/db.h
  7. 6
      include/rocksdb/options.h

@ -23,6 +23,7 @@
* Remove deprecated API AdvancedColumnFamilyOptions::rate_limit_delay_max_milliseconds.
* Removed timestamp from WriteOptions. Accordingly, added to DB APIs Put, Delete, SingleDelete, etc. accepting an additional argument 'timestamp'. Added Put, Delete, SingleDelete, etc to WriteBatch accepting an additional argument 'timestamp'. Removed WriteBatch::AssignTimestamps(vector<Slice>) API. Renamed WriteBatch::AssignTimestamp() to WriteBatch::UpdateTimestamps() with clarified comments.
* Remove default implementation of Name() from FileSystemWrapper.
* Rename `SizeApproximationOptions.include_memtabtles` to `SizeApproximationOptions.include_memtables`.
### Behavior Changes
* Disallow the combination of DBOptions.use_direct_io_for_flush_and_compaction == true and DBOptions.writable_file_max_buffer_size == 0. This combination can cause WritableFileWriter::Append() to loop forever, and it does not make much sense in direct IO.

@ -3592,7 +3592,7 @@ void DBImpl::GetApproximateMemTableStats(ColumnFamilyHandle* column_family,
Status DBImpl::GetApproximateSizes(const SizeApproximationOptions& options,
ColumnFamilyHandle* column_family,
const Range* range, int n, uint64_t* sizes) {
if (!options.include_memtabtles && !options.include_files) {
if (!options.include_memtables && !options.include_files) {
return Status::InvalidArgument("Invalid options");
}
@ -3630,7 +3630,7 @@ Status DBImpl::GetApproximateSizes(const SizeApproximationOptions& options,
options, v, k1.Encode(), k2.Encode(), /*start_level=*/0,
/*end_level=*/-1, TableReaderCaller::kUserApproximateSize);
}
if (options.include_memtabtles) {
if (options.include_memtables) {
sizes[i] += sv->mem->ApproximateStats(k1.Encode(), k2.Encode()).size;
sizes[i] += sv->imm->ApproximateStats(k1.Encode(), k2.Encode()).size;
}

@ -1450,7 +1450,7 @@ TEST_F(DBTest, ApproximateSizesMemTable) {
std::string end = Key(60);
Range r(start, end);
SizeApproximationOptions size_approx_options;
size_approx_options.include_memtabtles = true;
size_approx_options.include_memtables = true;
size_approx_options.include_files = true;
ASSERT_OK(
db_->GetApproximateSizes(size_approx_options, default_cf, &r, 1, &size));
@ -1551,8 +1551,8 @@ TEST_F(DBTest, ApproximateSizesMemTable) {
ASSERT_GT(size_with_mt, size_without_mt);
ASSERT_GT(size_without_mt, 6000);
// Check that include_memtabtles flag works as expected
size_approx_options.include_memtabtles = false;
// Check that include_memtables flag works as expected
size_approx_options.include_memtables = false;
ASSERT_OK(
db_->GetApproximateSizes(size_approx_options, default_cf, &r, 1, &size));
ASSERT_EQ(size, size_without_mt);
@ -1614,7 +1614,7 @@ TEST_F(DBTest, ApproximateSizesFilesWithErrorMargin) {
const Range r(start, end);
SizeApproximationOptions size_approx_options;
size_approx_options.include_memtabtles = false;
size_approx_options.include_memtables = false;
size_approx_options.include_files = true;
size_approx_options.files_size_error_margin = -1.0; // disabled

@ -572,7 +572,7 @@ TEST_F(DBBasicTestWithTimestamp, GetApproximateSizes) {
std::string end = Key(60);
Range r(start, end);
SizeApproximationOptions size_approx_options;
size_approx_options.include_memtabtles = true;
size_approx_options.include_memtables = true;
size_approx_options.include_files = true;
ASSERT_OK(
db_->GetApproximateSizes(size_approx_options, default_cf, &r, 1, &size));

@ -1669,8 +1669,8 @@ Status StressTest::TestApproximateSize(
std::string key2_str = Key(key2);
Range range{Slice(key1_str), Slice(key2_str)};
SizeApproximationOptions sao;
sao.include_memtabtles = thread->rand.OneIn(2);
if (sao.include_memtabtles) {
sao.include_memtables = thread->rand.OneIn(2);
if (sao.include_memtables) {
sao.include_files = thread->rand.OneIn(2);
}
if (thread->rand.OneIn(2)) {

@ -1139,7 +1139,7 @@ class DB {
uint64_t* sizes,
uint8_t include_flags = INCLUDE_FILES) {
SizeApproximationOptions options;
options.include_memtabtles =
options.include_memtables =
(include_flags & SizeApproximationFlags::INCLUDE_MEMTABLES) != 0;
options.include_files =
(include_flags & SizeApproximationFlags::INCLUDE_FILES) != 0;

@ -1870,10 +1870,10 @@ struct ImportColumnFamilyOptions {
// Options used with DB::GetApproximateSizes()
struct SizeApproximationOptions {
// Defines whether the returned size should include the recently written
// data in the mem-tables. If set to false, include_files must be true.
bool include_memtabtles = false;
// data in the memtables. If set to false, include_files must be true.
bool include_memtables = false;
// Defines whether the returned size should include data serialized to disk.
// If set to false, include_memtabtles must be true.
// If set to false, include_memtables must be true.
bool include_files = true;
// When approximating the files total size that is used to store a keys range
// using DB::GetApproximateSizes, allow approximation with an error margin of

Loading…
Cancel
Save