Fixed -WShadow errors in db/db_test.cc and include/rocksdb/metadata.h

Summary:
Fixed -WShadow errors in db/db_test.cc and include/rocksdb/metadata.h

Test Plan:
make
main
Yueh-Hsuan Chiang 10 years ago
parent 28c82ff1b3
commit 8447861896
  1. 16
      db/db_test.cc
  2. 36
      include/rocksdb/metadata.h

@ -8333,9 +8333,9 @@ namespace {
} // namespace } // namespace
TEST(DBTest, CompactFilesOnLevelCompaction) { TEST(DBTest, CompactFilesOnLevelCompaction) {
const int kKeySize = 16; const int kTestKeySize = 16;
const int kValueSize = 984; const int kTestValueSize = 984;
const int kEntrySize = kKeySize + kValueSize; const int kEntrySize = kTestKeySize + kTestValueSize;
const int kEntriesPerBuffer = 100; const int kEntriesPerBuffer = 100;
Options options; Options options;
options.create_if_missing = true; options.create_if_missing = true;
@ -8351,7 +8351,7 @@ TEST(DBTest, CompactFilesOnLevelCompaction) {
Random rnd(301); Random rnd(301);
for (int key = 64 * kEntriesPerBuffer; key >= 0; --key) { for (int key = 64 * kEntriesPerBuffer; key >= 0; --key) {
ASSERT_OK(Put(1, std::to_string(key), RandomString(&rnd, kValueSize))); ASSERT_OK(Put(1, std::to_string(key), RandomString(&rnd, kTestValueSize)));
} }
dbfull()->TEST_WaitForFlushMemTable(handles_[1]); dbfull()->TEST_WaitForFlushMemTable(handles_[1]);
dbfull()->TEST_WaitForCompact(); dbfull()->TEST_WaitForCompact();
@ -8388,9 +8388,9 @@ TEST(DBTest, CompactFilesOnLevelCompaction) {
} }
TEST(DBTest, CompactFilesOnUniversalCompaction) { TEST(DBTest, CompactFilesOnUniversalCompaction) {
const int kKeySize = 16; const int kTestKeySize = 16;
const int kValueSize = 984; const int kTestValueSize = 984;
const int kEntrySize = kKeySize + kValueSize; const int kEntrySize = kTestKeySize + kTestValueSize;
const int kEntriesPerBuffer = 10; const int kEntriesPerBuffer = 10;
ChangeCompactOptions(); ChangeCompactOptions();
@ -8405,7 +8405,7 @@ TEST(DBTest, CompactFilesOnUniversalCompaction) {
ASSERT_EQ(options.compaction_style, kCompactionStyleUniversal); ASSERT_EQ(options.compaction_style, kCompactionStyleUniversal);
Random rnd(301); Random rnd(301);
for (int key = 1024 * kEntriesPerBuffer; key >= 0; --key) { for (int key = 1024 * kEntriesPerBuffer; key >= 0; --key) {
ASSERT_OK(Put(1, std::to_string(key), RandomString(&rnd, kValueSize))); ASSERT_OK(Put(1, std::to_string(key), RandomString(&rnd, kTestValueSize)));
} }
dbfull()->TEST_WaitForFlushMemTable(handles_[1]); dbfull()->TEST_WaitForFlushMemTable(handles_[1]);
dbfull()->TEST_WaitForCompact(); dbfull()->TEST_WaitForCompact();

@ -19,9 +19,9 @@ struct SstFileMetaData;
// The metadata that describes a column family. // The metadata that describes a column family.
struct ColumnFamilyMetaData { struct ColumnFamilyMetaData {
ColumnFamilyMetaData() : size(0), name("") {} ColumnFamilyMetaData() : size(0), name("") {}
ColumnFamilyMetaData(const std::string& name, uint64_t size, ColumnFamilyMetaData(const std::string& _name, uint64_t _size,
const std::vector<LevelMetaData>&& levels) : const std::vector<LevelMetaData>&& _levels) :
size(size), name(name), levels(levels) {} size(_size), name(_name), levels(_levels) {}
// The size of this column family in bytes, which is equal to the sum of // The size of this column family in bytes, which is equal to the sum of
// the file size of its "levels". // the file size of its "levels".
@ -36,10 +36,10 @@ struct ColumnFamilyMetaData {
// The metadata that describes a level. // The metadata that describes a level.
struct LevelMetaData { struct LevelMetaData {
LevelMetaData(int level, uint64_t size, LevelMetaData(int _level, uint64_t _size,
const std::vector<SstFileMetaData>&& files) : const std::vector<SstFileMetaData>&& _files) :
level(level), size(size), level(_level), size(_size),
files(files) {} files(_files) {}
// The level which this meta data describes. // The level which this meta data describes.
const int level; const int level;
@ -53,17 +53,17 @@ struct LevelMetaData {
// The metadata that describes a SST file. // The metadata that describes a SST file.
struct SstFileMetaData { struct SstFileMetaData {
SstFileMetaData() {} SstFileMetaData() {}
SstFileMetaData(const std::string& file_name, SstFileMetaData(const std::string& _file_name,
const std::string& path, uint64_t size, const std::string& _path, uint64_t _size,
SequenceNumber smallest_seqno, SequenceNumber _smallest_seqno,
SequenceNumber largest_seqno, SequenceNumber _largest_seqno,
const std::string& smallestkey, const std::string& _smallestkey,
const std::string& largestkey, const std::string& _largestkey,
bool being_compacted) : bool _being_compacted) :
size(size), name(file_name), size(_size), name(_file_name),
db_path(path), smallest_seqno(smallest_seqno), largest_seqno(largest_seqno), db_path(_path), smallest_seqno(_smallest_seqno), largest_seqno(_largest_seqno),
smallestkey(smallestkey), largestkey(largestkey), smallestkey(_smallestkey), largestkey(_largestkey),
being_compacted(being_compacted) {} being_compacted(_being_compacted) {}
// File size in bytes. // File size in bytes.
uint64_t size; uint64_t size;

Loading…
Cancel
Save