Skip to content

Commit 5d68243

Browse files
ajkrfacebook-github-bot
authored andcommitted
Comment out unused variables
Summary: Submitting on behalf of another employee. Closes facebook#3557 Differential Revision: D7146025 Pulled By: ajkr fbshipit-source-id: 495ca5db5beec3789e671e26f78170957704e77e
1 parent 1ccdc2c commit 5d68243

File tree

172 files changed

+1014
-929
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+1014
-929
lines changed

cache/cache_test.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ static int DecodeValue(void* v) {
4040
const std::string kLRU = "lru";
4141
const std::string kClock = "clock";
4242

43-
void dumbDeleter(const Slice& key, void* value) {}
43+
void dumbDeleter(const Slice& /*key*/, void* /*value*/) {}
4444

45-
void eraseDeleter(const Slice& key, void* value) {
45+
void eraseDeleter(const Slice& /*key*/, void* value) {
4646
Cache* cache = reinterpret_cast<Cache*>(value);
4747
cache->Erase("foo");
4848
}
@@ -470,7 +470,7 @@ class Value {
470470
};
471471

472472
namespace {
473-
void deleter(const Slice& key, void* value) {
473+
void deleter(const Slice& /*key*/, void* value) {
474474
delete static_cast<Value *>(value);
475475
}
476476
} // namespace

cache/clock_cache.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ Status ClockCacheShard::Insert(const Slice& key, uint32_t hash, void* value,
586586
size_t charge,
587587
void (*deleter)(const Slice& key, void* value),
588588
Cache::Handle** out_handle,
589-
Cache::Priority priority) {
589+
Cache::Priority /*priority*/) {
590590
CleanupContext context;
591591
HashTable::accessor accessor;
592592
char* key_data = new char[key.size()];

cache/sharded_cache.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Status ShardedCache::Insert(const Slice& key, void* value, size_t charge,
5353
->Insert(key, hash, value, charge, deleter, handle, priority);
5454
}
5555

56-
Cache::Handle* ShardedCache::Lookup(const Slice& key, Statistics* stats) {
56+
Cache::Handle* ShardedCache::Lookup(const Slice& key, Statistics* /*stats*/) {
5757
uint32_t hash = HashSlice(key);
5858
return GetShard(Shard(hash))->Lookup(key, hash);
5959
}

db/builder.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ TableBuilder* NewTableBuilder(
6161

6262
Status BuildTable(
6363
const std::string& dbname, Env* env, const ImmutableCFOptions& ioptions,
64-
const MutableCFOptions& mutable_cf_options, const EnvOptions& env_options,
65-
TableCache* table_cache, InternalIterator* iter,
66-
std::unique_ptr<InternalIterator> range_del_iter, FileMetaData* meta,
67-
const InternalKeyComparator& internal_comparator,
64+
const MutableCFOptions& /*mutable_cf_options*/,
65+
const EnvOptions& env_options, TableCache* table_cache,
66+
InternalIterator* iter, std::unique_ptr<InternalIterator> range_del_iter,
67+
FileMetaData* meta, const InternalKeyComparator& internal_comparator,
6868
const std::vector<std::unique_ptr<IntTblPropCollectorFactory>>*
6969
int_tbl_prop_collector_factories,
7070
uint32_t column_family_id, const std::string& column_family_name,

db/c.cc

+8-8
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ struct rocksdb_comparator_t : public Comparator {
252252
// No-ops since the C binding does not support key shortening methods.
253253
virtual void FindShortestSeparator(std::string*,
254254
const Slice&) const override {}
255-
virtual void FindShortSuccessor(std::string* key) const override {}
255+
virtual void FindShortSuccessor(std::string* /*key*/) const override {}
256256
};
257257

258258
struct rocksdb_filterpolicy_t : public FilterPolicy {
@@ -367,7 +367,7 @@ struct rocksdb_mergeoperator_t : public MergeOperator {
367367
virtual bool PartialMergeMulti(const Slice& key,
368368
const std::deque<Slice>& operand_list,
369369
std::string* new_value,
370-
Logger* logger) const override {
370+
Logger* /*logger*/) const override {
371371
size_t operand_count = operand_list.size();
372372
std::vector<const char*> operand_pointers(operand_count);
373373
std::vector<size_t> operand_sizes(operand_count);
@@ -2166,8 +2166,8 @@ void rocksdb_options_set_level0_stop_writes_trigger(
21662166
opt->rep.level0_stop_writes_trigger = n;
21672167
}
21682168

2169-
void rocksdb_options_set_max_mem_compaction_level(rocksdb_options_t* opt,
2170-
int n) {}
2169+
void rocksdb_options_set_max_mem_compaction_level(rocksdb_options_t* /*opt*/,
2170+
int /*n*/) {}
21712171

21722172
void rocksdb_options_set_wal_recovery_mode(rocksdb_options_t* opt,int mode) {
21732173
opt->rep.wal_recovery_mode = static_cast<WALRecoveryMode>(mode);
@@ -2231,8 +2231,8 @@ void rocksdb_options_set_manifest_preallocation_size(
22312231
}
22322232

22332233
// noop
2234-
void rocksdb_options_set_purge_redundant_kvs_while_flush(rocksdb_options_t* opt,
2235-
unsigned char v) {}
2234+
void rocksdb_options_set_purge_redundant_kvs_while_flush(
2235+
rocksdb_options_t* /*opt*/, unsigned char /*v*/) {}
22362236

22372237
void rocksdb_options_set_use_direct_reads(rocksdb_options_t* opt,
22382238
unsigned char v) {
@@ -2402,7 +2402,7 @@ void rocksdb_options_set_table_cache_numshardbits(
24022402
}
24032403

24042404
void rocksdb_options_set_table_cache_remove_scan_count_limit(
2405-
rocksdb_options_t* opt, int v) {
2405+
rocksdb_options_t* /*opt*/, int /*v*/) {
24062406
// this option is deprecated
24072407
}
24082408

@@ -2973,7 +2973,7 @@ rocksdb_sstfilewriter_t* rocksdb_sstfilewriter_create(
29732973

29742974
rocksdb_sstfilewriter_t* rocksdb_sstfilewriter_create_with_comparator(
29752975
const rocksdb_envoptions_t* env, const rocksdb_options_t* io_options,
2976-
const rocksdb_comparator_t* comparator) {
2976+
const rocksdb_comparator_t* /*comparator*/) {
29772977
rocksdb_sstfilewriter_t* writer = new rocksdb_sstfilewriter_t;
29782978
writer->rep = new SstFileWriter(env->rep, io_options->rep);
29792979
return writer;

db/column_family_test.cc

+5-4
Original file line numberDiff line numberDiff line change
@@ -1168,13 +1168,14 @@ TEST_F(ColumnFamilyTest, MemtableNotSupportSnapshot) {
11681168
#endif // !ROCKSDB_LITE
11691169

11701170
class TestComparator : public Comparator {
1171-
int Compare(const rocksdb::Slice& a, const rocksdb::Slice& b) const override {
1171+
int Compare(const rocksdb::Slice& /*a*/,
1172+
const rocksdb::Slice& /*b*/) const override {
11721173
return 0;
11731174
}
11741175
const char* Name() const override { return "Test"; }
1175-
void FindShortestSeparator(std::string* start,
1176-
const rocksdb::Slice& limit) const override {}
1177-
void FindShortSuccessor(std::string* key) const override {}
1176+
void FindShortestSeparator(std::string* /*start*/,
1177+
const rocksdb::Slice& /*limit*/) const override {}
1178+
void FindShortSuccessor(std::string* /*key*/) const override {}
11781179
};
11791180

11801181
static TestComparator third_comparator;

db/compact_files_test.cc

+4-5
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ class FlushedFileCollector : public EventListener {
3737
FlushedFileCollector() {}
3838
~FlushedFileCollector() {}
3939

40-
virtual void OnFlushCompleted(
41-
DB* db, const FlushJobInfo& info) override {
40+
virtual void OnFlushCompleted(DB* /*db*/, const FlushJobInfo& info) override {
4241
std::lock_guard<std::mutex> lock(mutex_);
4342
flushed_files_.push_back(info.file_path);
4443
}
@@ -257,9 +256,9 @@ TEST_F(CompactFilesTest, CapturingPendingFiles) {
257256
TEST_F(CompactFilesTest, CompactionFilterWithGetSv) {
258257
class FilterWithGet : public CompactionFilter {
259258
public:
260-
virtual bool Filter(int level, const Slice& key, const Slice& value,
261-
std::string* new_value,
262-
bool* value_changed) const override {
259+
virtual bool Filter(int /*level*/, const Slice& /*key*/,
260+
const Slice& /*value*/, std::string* /*new_value*/,
261+
bool* /*value_changed*/) const override {
263262
if (db_ == nullptr) {
264263
return true;
265264
}

db/compacted_db_impl.h

+23-22
Original file line numberDiff line numberDiff line change
@@ -32,55 +32,56 @@ class CompactedDBImpl : public DBImpl {
3232
override;
3333

3434
using DBImpl::Put;
35-
virtual Status Put(const WriteOptions& options,
36-
ColumnFamilyHandle* column_family, const Slice& key,
37-
const Slice& value) override {
35+
virtual Status Put(const WriteOptions& /*options*/,
36+
ColumnFamilyHandle* /*column_family*/,
37+
const Slice& /*key*/, const Slice& /*value*/) override {
3838
return Status::NotSupported("Not supported in compacted db mode.");
3939
}
4040
using DBImpl::Merge;
41-
virtual Status Merge(const WriteOptions& options,
42-
ColumnFamilyHandle* column_family, const Slice& key,
43-
const Slice& value) override {
41+
virtual Status Merge(const WriteOptions& /*options*/,
42+
ColumnFamilyHandle* /*column_family*/,
43+
const Slice& /*key*/, const Slice& /*value*/) override {
4444
return Status::NotSupported("Not supported in compacted db mode.");
4545
}
4646
using DBImpl::Delete;
47-
virtual Status Delete(const WriteOptions& options,
48-
ColumnFamilyHandle* column_family,
49-
const Slice& key) override {
47+
virtual Status Delete(const WriteOptions& /*options*/,
48+
ColumnFamilyHandle* /*column_family*/,
49+
const Slice& /*key*/) override {
5050
return Status::NotSupported("Not supported in compacted db mode.");
5151
}
52-
virtual Status Write(const WriteOptions& options,
53-
WriteBatch* updates) override {
52+
virtual Status Write(const WriteOptions& /*options*/,
53+
WriteBatch* /*updates*/) override {
5454
return Status::NotSupported("Not supported in compacted db mode.");
5555
}
5656
using DBImpl::CompactRange;
57-
virtual Status CompactRange(const CompactRangeOptions& options,
58-
ColumnFamilyHandle* column_family,
59-
const Slice* begin, const Slice* end) override {
57+
virtual Status CompactRange(const CompactRangeOptions& /*options*/,
58+
ColumnFamilyHandle* /*column_family*/,
59+
const Slice* /*begin*/,
60+
const Slice* /*end*/) override {
6061
return Status::NotSupported("Not supported in compacted db mode.");
6162
}
6263

6364
virtual Status DisableFileDeletions() override {
6465
return Status::NotSupported("Not supported in compacted db mode.");
6566
}
66-
virtual Status EnableFileDeletions(bool force) override {
67+
virtual Status EnableFileDeletions(bool /*force*/) override {
6768
return Status::NotSupported("Not supported in compacted db mode.");
6869
}
6970
virtual Status GetLiveFiles(std::vector<std::string>&,
70-
uint64_t* manifest_file_size,
71-
bool flush_memtable = true) override {
71+
uint64_t* /*manifest_file_size*/,
72+
bool /*flush_memtable*/ = true) override {
7273
return Status::NotSupported("Not supported in compacted db mode.");
7374
}
7475
using DBImpl::Flush;
75-
virtual Status Flush(const FlushOptions& options,
76-
ColumnFamilyHandle* column_family) override {
76+
virtual Status Flush(const FlushOptions& /*options*/,
77+
ColumnFamilyHandle* /*column_family*/) override {
7778
return Status::NotSupported("Not supported in compacted db mode.");
7879
}
7980
using DB::IngestExternalFile;
8081
virtual Status IngestExternalFile(
81-
ColumnFamilyHandle* column_family,
82-
const std::vector<std::string>& external_files,
83-
const IngestExternalFileOptions& ingestion_options) override {
82+
ColumnFamilyHandle* /*column_family*/,
83+
const std::vector<std::string>& /*external_files*/,
84+
const IngestExternalFileOptions& /*ingestion_options*/) override {
8485
return Status::NotSupported("Not supported in compacted db mode.");
8586
}
8687

db/compaction_iterator.cc

+2-3
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,14 @@ CompactionIterator::CompactionIterator(
3131

3232
CompactionIterator::CompactionIterator(
3333
InternalIterator* input, const Comparator* cmp, MergeHelper* merge_helper,
34-
SequenceNumber last_sequence, std::vector<SequenceNumber>* snapshots,
34+
SequenceNumber /*last_sequence*/, std::vector<SequenceNumber>* snapshots,
3535
SequenceNumber earliest_write_conflict_snapshot,
3636
const SnapshotChecker* snapshot_checker, Env* env,
3737
bool expect_valid_internal_key, RangeDelAggregator* range_del_agg,
3838
std::unique_ptr<CompactionProxy> compaction,
3939
const CompactionFilter* compaction_filter,
4040
const std::atomic<bool>* shutting_down,
41-
const SequenceNumber preserve_deletes_seqnum
42-
)
41+
const SequenceNumber preserve_deletes_seqnum)
4342
: input_(input),
4443
cmp_(cmp),
4544
merge_helper_(merge_helper),

db/compaction_iterator.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class CompactionIterator {
3030
: compaction_(compaction) {}
3131

3232
virtual ~CompactionProxy() = default;
33-
virtual int level(size_t compaction_input_level = 0) const {
33+
virtual int level(size_t /*compaction_input_level*/ = 0) const {
3434
return compaction_->level();
3535
}
3636
virtual bool KeyNotExistsBeyondOutputLevel(

db/compaction_iterator_test.cc

+18-15
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ namespace rocksdb {
1919
// Expects no merging attempts.
2020
class NoMergingMergeOp : public MergeOperator {
2121
public:
22-
bool FullMergeV2(const MergeOperationInput& merge_in,
23-
MergeOperationOutput* merge_out) const override {
22+
bool FullMergeV2(const MergeOperationInput& /*merge_in*/,
23+
MergeOperationOutput* /*merge_out*/) const override {
2424
ADD_FAILURE();
2525
return false;
2626
}
27-
bool PartialMergeMulti(const Slice& key,
28-
const std::deque<Slice>& operand_list,
29-
std::string* new_value,
30-
Logger* logger) const override {
27+
bool PartialMergeMulti(const Slice& /*key*/,
28+
const std::deque<Slice>& /*operand_list*/,
29+
std::string* /*new_value*/,
30+
Logger* /*logger*/) const override {
3131
ADD_FAILURE();
3232
return false;
3333
}
@@ -126,7 +126,7 @@ class LoggingForwardVectorIterator : public InternalIterator {
126126
keys_.begin();
127127
}
128128

129-
virtual void SeekForPrev(const Slice& target) override { assert(false); }
129+
virtual void SeekForPrev(const Slice& /*target*/) override { assert(false); }
130130

131131
virtual void Next() override {
132132
assert(Valid());
@@ -158,9 +158,12 @@ class FakeCompaction : public CompactionIterator::CompactionProxy {
158158
public:
159159
FakeCompaction() = default;
160160

161-
virtual int level(size_t compaction_input_level) const override { return 0; }
161+
virtual int level(size_t /*compaction_input_level*/) const override {
162+
return 0;
163+
}
162164
virtual bool KeyNotExistsBeyondOutputLevel(
163-
const Slice& user_key, std::vector<size_t>* level_ptrs) const override {
165+
const Slice& /*user_key*/,
166+
std::vector<size_t>* /*level_ptrs*/) const override {
164167
return is_bottommost_level || key_not_exists_beyond_output_level;
165168
}
166169
virtual bool bottommost_level() const override { return is_bottommost_level; }
@@ -365,9 +368,9 @@ TEST_P(CompactionIteratorTest, RangeDeletionWithSnapshots) {
365368

366369
TEST_P(CompactionIteratorTest, CompactionFilterSkipUntil) {
367370
class Filter : public CompactionFilter {
368-
virtual Decision FilterV2(int level, const Slice& key, ValueType t,
371+
virtual Decision FilterV2(int /*level*/, const Slice& key, ValueType t,
369372
const Slice& existing_value,
370-
std::string* new_value,
373+
std::string* /*new_value*/,
371374
std::string* skip_until) const override {
372375
std::string k = key.ToString();
373376
std::string v = existing_value.ToString();
@@ -548,10 +551,10 @@ TEST_P(CompactionIteratorTest, ShuttingDownInMerge) {
548551

549552
TEST_P(CompactionIteratorTest, SingleMergeOperand) {
550553
class Filter : public CompactionFilter {
551-
virtual Decision FilterV2(int level, const Slice& key, ValueType t,
554+
virtual Decision FilterV2(int /*level*/, const Slice& key, ValueType t,
552555
const Slice& existing_value,
553-
std::string* new_value,
554-
std::string* skip_until) const override {
556+
std::string* /*new_value*/,
557+
std::string* /*skip_until*/) const override {
555558
std::string k = key.ToString();
556559
std::string v = existing_value.ToString();
557560

@@ -602,7 +605,7 @@ TEST_P(CompactionIteratorTest, SingleMergeOperand) {
602605
bool PartialMergeMulti(const Slice& key,
603606
const std::deque<Slice>& operand_list,
604607
std::string* new_value,
605-
Logger* logger) const override {
608+
Logger* /*logger*/) const override {
606609
std::string string_key = key.ToString();
607610
EXPECT_TRUE(string_key == "a" || string_key == "b");
608611

db/compaction_job_stats_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ class CompactionJobStatsChecker : public EventListener {
426426
// Once a compaction completed, this function will verify the returned
427427
// CompactionJobInfo with the oldest CompactionJobInfo added earlier
428428
// in "expected_stats_" which has not yet being used for verification.
429-
virtual void OnCompactionCompleted(DB *db, const CompactionJobInfo& ci) {
429+
virtual void OnCompactionCompleted(DB* /*db*/, const CompactionJobInfo& ci) {
430430
if (verify_next_comp_io_stats_) {
431431
ASSERT_GT(ci.stats.file_write_nanos, 0);
432432
ASSERT_GT(ci.stats.file_range_sync_nanos, 0);

db/compaction_picker.cc

+5-4
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ void CompactionPicker::GetRange(const std::vector<CompactionInputFiles>& inputs,
199199
assert(initialized);
200200
}
201201

202-
bool CompactionPicker::ExpandInputsToCleanCut(const std::string& cf_name,
202+
bool CompactionPicker::ExpandInputsToCleanCut(const std::string& /*cf_name*/,
203203
VersionStorageInfo* vstorage,
204204
CompactionInputFiles* inputs) {
205205
// This isn't good compaction
@@ -309,7 +309,7 @@ Compaction* CompactionPicker::CompactFiles(
309309
Status CompactionPicker::GetCompactionInputsFromFileNumbers(
310310
std::vector<CompactionInputFiles>* input_files,
311311
std::unordered_set<uint64_t>* input_set, const VersionStorageInfo* vstorage,
312-
const CompactionOptions& compact_options) const {
312+
const CompactionOptions& /*compact_options*/) const {
313313
if (input_set->size() == 0U) {
314314
return Status::InvalidArgument(
315315
"Compaction must include at least one file.");
@@ -1612,8 +1612,9 @@ Compaction* FIFOCompactionPicker::PickCompaction(
16121612
Compaction* FIFOCompactionPicker::CompactRange(
16131613
const std::string& cf_name, const MutableCFOptions& mutable_cf_options,
16141614
VersionStorageInfo* vstorage, int input_level, int output_level,
1615-
uint32_t output_path_id, const InternalKey* begin, const InternalKey* end,
1616-
InternalKey** compaction_end, bool* manual_conflict) {
1615+
uint32_t /*output_path_id*/, const InternalKey* /*begin*/,
1616+
const InternalKey* /*end*/, InternalKey** compaction_end,
1617+
bool* /*manual_conflict*/) {
16171618
assert(input_level == 0);
16181619
assert(output_level == 0);
16191620
*compaction_end = nullptr;

0 commit comments

Comments
 (0)