mirror of https://github.com/facebook/rocksdb.git
- comment out unused parameters
Reviewed By: everiq, igorsugak Differential Revision: D7046710 fbshipit-source-id: 8e10b1f1e2aecebbfb229c742e214db887e5a461
This commit is contained in:
parent
b092977643
commit
f4a030ce81
|
@ -40,9 +40,9 @@ static int DecodeValue(void* v) {
|
|||
const std::string kLRU = "lru";
|
||||
const std::string kClock = "clock";
|
||||
|
||||
void dumbDeleter(const Slice& key, void* value) {}
|
||||
void dumbDeleter(const Slice& /*key*/, void* /*value*/) {}
|
||||
|
||||
void eraseDeleter(const Slice& key, void* value) {
|
||||
void eraseDeleter(const Slice& /*key*/, void* value) {
|
||||
Cache* cache = reinterpret_cast<Cache*>(value);
|
||||
cache->Erase("foo");
|
||||
}
|
||||
|
@ -470,7 +470,7 @@ class Value {
|
|||
};
|
||||
|
||||
namespace {
|
||||
void deleter(const Slice& key, void* value) {
|
||||
void deleter(const Slice& /*key*/, void* value) {
|
||||
delete static_cast<Value *>(value);
|
||||
}
|
||||
} // namespace
|
||||
|
|
|
@ -586,7 +586,7 @@ Status ClockCacheShard::Insert(const Slice& key, uint32_t hash, void* value,
|
|||
size_t charge,
|
||||
void (*deleter)(const Slice& key, void* value),
|
||||
Cache::Handle** out_handle,
|
||||
Cache::Priority priority) {
|
||||
Cache::Priority /*priority*/) {
|
||||
CleanupContext context;
|
||||
HashTable::accessor accessor;
|
||||
char* key_data = new char[key.size()];
|
||||
|
|
|
@ -53,7 +53,7 @@ Status ShardedCache::Insert(const Slice& key, void* value, size_t charge,
|
|||
->Insert(key, hash, value, charge, deleter, handle, priority);
|
||||
}
|
||||
|
||||
Cache::Handle* ShardedCache::Lookup(const Slice& key, Statistics* stats) {
|
||||
Cache::Handle* ShardedCache::Lookup(const Slice& key, Statistics* /*stats*/) {
|
||||
uint32_t hash = HashSlice(key);
|
||||
return GetShard(Shard(hash))->Lookup(key, hash);
|
||||
}
|
||||
|
|
|
@ -61,10 +61,10 @@ TableBuilder* NewTableBuilder(
|
|||
|
||||
Status BuildTable(
|
||||
const std::string& dbname, Env* env, const ImmutableCFOptions& ioptions,
|
||||
const MutableCFOptions& mutable_cf_options, const EnvOptions& env_options,
|
||||
TableCache* table_cache, InternalIterator* iter,
|
||||
std::unique_ptr<InternalIterator> range_del_iter, FileMetaData* meta,
|
||||
const InternalKeyComparator& internal_comparator,
|
||||
const MutableCFOptions& /*mutable_cf_options*/,
|
||||
const EnvOptions& env_options, TableCache* table_cache,
|
||||
InternalIterator* iter, std::unique_ptr<InternalIterator> range_del_iter,
|
||||
FileMetaData* meta, const InternalKeyComparator& internal_comparator,
|
||||
const std::vector<std::unique_ptr<IntTblPropCollectorFactory>>*
|
||||
int_tbl_prop_collector_factories,
|
||||
uint32_t column_family_id, const std::string& column_family_name,
|
||||
|
|
16
db/c.cc
16
db/c.cc
|
@ -252,7 +252,7 @@ struct rocksdb_comparator_t : public Comparator {
|
|||
// No-ops since the C binding does not support key shortening methods.
|
||||
virtual void FindShortestSeparator(std::string*,
|
||||
const Slice&) const override {}
|
||||
virtual void FindShortSuccessor(std::string* key) const override {}
|
||||
virtual void FindShortSuccessor(std::string* /*key*/) const override {}
|
||||
};
|
||||
|
||||
struct rocksdb_filterpolicy_t : public FilterPolicy {
|
||||
|
@ -367,7 +367,7 @@ struct rocksdb_mergeoperator_t : public MergeOperator {
|
|||
virtual bool PartialMergeMulti(const Slice& key,
|
||||
const std::deque<Slice>& operand_list,
|
||||
std::string* new_value,
|
||||
Logger* logger) const override {
|
||||
Logger* /*logger*/) const override {
|
||||
size_t operand_count = operand_list.size();
|
||||
std::vector<const char*> operand_pointers(operand_count);
|
||||
std::vector<size_t> operand_sizes(operand_count);
|
||||
|
@ -2166,8 +2166,8 @@ void rocksdb_options_set_level0_stop_writes_trigger(
|
|||
opt->rep.level0_stop_writes_trigger = n;
|
||||
}
|
||||
|
||||
void rocksdb_options_set_max_mem_compaction_level(rocksdb_options_t* opt,
|
||||
int n) {}
|
||||
void rocksdb_options_set_max_mem_compaction_level(rocksdb_options_t* /*opt*/,
|
||||
int /*n*/) {}
|
||||
|
||||
void rocksdb_options_set_wal_recovery_mode(rocksdb_options_t* opt,int mode) {
|
||||
opt->rep.wal_recovery_mode = static_cast<WALRecoveryMode>(mode);
|
||||
|
@ -2231,8 +2231,8 @@ void rocksdb_options_set_manifest_preallocation_size(
|
|||
}
|
||||
|
||||
// noop
|
||||
void rocksdb_options_set_purge_redundant_kvs_while_flush(rocksdb_options_t* opt,
|
||||
unsigned char v) {}
|
||||
void rocksdb_options_set_purge_redundant_kvs_while_flush(
|
||||
rocksdb_options_t* /*opt*/, unsigned char /*v*/) {}
|
||||
|
||||
void rocksdb_options_set_use_direct_reads(rocksdb_options_t* opt,
|
||||
unsigned char v) {
|
||||
|
@ -2402,7 +2402,7 @@ void rocksdb_options_set_table_cache_numshardbits(
|
|||
}
|
||||
|
||||
void rocksdb_options_set_table_cache_remove_scan_count_limit(
|
||||
rocksdb_options_t* opt, int v) {
|
||||
rocksdb_options_t* /*opt*/, int /*v*/) {
|
||||
// this option is deprecated
|
||||
}
|
||||
|
||||
|
@ -2973,7 +2973,7 @@ rocksdb_sstfilewriter_t* rocksdb_sstfilewriter_create(
|
|||
|
||||
rocksdb_sstfilewriter_t* rocksdb_sstfilewriter_create_with_comparator(
|
||||
const rocksdb_envoptions_t* env, const rocksdb_options_t* io_options,
|
||||
const rocksdb_comparator_t* comparator) {
|
||||
const rocksdb_comparator_t* /*comparator*/) {
|
||||
rocksdb_sstfilewriter_t* writer = new rocksdb_sstfilewriter_t;
|
||||
writer->rep = new SstFileWriter(env->rep, io_options->rep);
|
||||
return writer;
|
||||
|
|
|
@ -1168,13 +1168,14 @@ TEST_F(ColumnFamilyTest, MemtableNotSupportSnapshot) {
|
|||
#endif // !ROCKSDB_LITE
|
||||
|
||||
class TestComparator : public Comparator {
|
||||
int Compare(const rocksdb::Slice& a, const rocksdb::Slice& b) const override {
|
||||
int Compare(const rocksdb::Slice& /*a*/,
|
||||
const rocksdb::Slice& /*b*/) const override {
|
||||
return 0;
|
||||
}
|
||||
const char* Name() const override { return "Test"; }
|
||||
void FindShortestSeparator(std::string* start,
|
||||
const rocksdb::Slice& limit) const override {}
|
||||
void FindShortSuccessor(std::string* key) const override {}
|
||||
void FindShortestSeparator(std::string* /*start*/,
|
||||
const rocksdb::Slice& /*limit*/) const override {}
|
||||
void FindShortSuccessor(std::string* /*key*/) const override {}
|
||||
};
|
||||
|
||||
static TestComparator third_comparator;
|
||||
|
|
|
@ -37,8 +37,7 @@ class FlushedFileCollector : public EventListener {
|
|||
FlushedFileCollector() {}
|
||||
~FlushedFileCollector() {}
|
||||
|
||||
virtual void OnFlushCompleted(
|
||||
DB* db, const FlushJobInfo& info) override {
|
||||
virtual void OnFlushCompleted(DB* /*db*/, const FlushJobInfo& info) override {
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
flushed_files_.push_back(info.file_path);
|
||||
}
|
||||
|
@ -257,9 +256,9 @@ TEST_F(CompactFilesTest, CapturingPendingFiles) {
|
|||
TEST_F(CompactFilesTest, CompactionFilterWithGetSv) {
|
||||
class FilterWithGet : public CompactionFilter {
|
||||
public:
|
||||
virtual bool Filter(int level, const Slice& key, const Slice& value,
|
||||
std::string* new_value,
|
||||
bool* value_changed) const override {
|
||||
virtual bool Filter(int /*level*/, const Slice& /*key*/,
|
||||
const Slice& /*value*/, std::string* /*new_value*/,
|
||||
bool* /*value_changed*/) const override {
|
||||
if (db_ == nullptr) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -32,55 +32,56 @@ class CompactedDBImpl : public DBImpl {
|
|||
override;
|
||||
|
||||
using DBImpl::Put;
|
||||
virtual Status Put(const WriteOptions& options,
|
||||
ColumnFamilyHandle* column_family, const Slice& key,
|
||||
const Slice& value) override {
|
||||
virtual Status Put(const WriteOptions& /*options*/,
|
||||
ColumnFamilyHandle* /*column_family*/,
|
||||
const Slice& /*key*/, const Slice& /*value*/) override {
|
||||
return Status::NotSupported("Not supported in compacted db mode.");
|
||||
}
|
||||
using DBImpl::Merge;
|
||||
virtual Status Merge(const WriteOptions& options,
|
||||
ColumnFamilyHandle* column_family, const Slice& key,
|
||||
const Slice& value) override {
|
||||
virtual Status Merge(const WriteOptions& /*options*/,
|
||||
ColumnFamilyHandle* /*column_family*/,
|
||||
const Slice& /*key*/, const Slice& /*value*/) override {
|
||||
return Status::NotSupported("Not supported in compacted db mode.");
|
||||
}
|
||||
using DBImpl::Delete;
|
||||
virtual Status Delete(const WriteOptions& options,
|
||||
ColumnFamilyHandle* column_family,
|
||||
const Slice& key) override {
|
||||
virtual Status Delete(const WriteOptions& /*options*/,
|
||||
ColumnFamilyHandle* /*column_family*/,
|
||||
const Slice& /*key*/) override {
|
||||
return Status::NotSupported("Not supported in compacted db mode.");
|
||||
}
|
||||
virtual Status Write(const WriteOptions& options,
|
||||
WriteBatch* updates) override {
|
||||
virtual Status Write(const WriteOptions& /*options*/,
|
||||
WriteBatch* /*updates*/) override {
|
||||
return Status::NotSupported("Not supported in compacted db mode.");
|
||||
}
|
||||
using DBImpl::CompactRange;
|
||||
virtual Status CompactRange(const CompactRangeOptions& options,
|
||||
ColumnFamilyHandle* column_family,
|
||||
const Slice* begin, const Slice* end) override {
|
||||
virtual Status CompactRange(const CompactRangeOptions& /*options*/,
|
||||
ColumnFamilyHandle* /*column_family*/,
|
||||
const Slice* /*begin*/,
|
||||
const Slice* /*end*/) override {
|
||||
return Status::NotSupported("Not supported in compacted db mode.");
|
||||
}
|
||||
|
||||
virtual Status DisableFileDeletions() override {
|
||||
return Status::NotSupported("Not supported in compacted db mode.");
|
||||
}
|
||||
virtual Status EnableFileDeletions(bool force) override {
|
||||
virtual Status EnableFileDeletions(bool /*force*/) override {
|
||||
return Status::NotSupported("Not supported in compacted db mode.");
|
||||
}
|
||||
virtual Status GetLiveFiles(std::vector<std::string>&,
|
||||
uint64_t* manifest_file_size,
|
||||
bool flush_memtable = true) override {
|
||||
uint64_t* /*manifest_file_size*/,
|
||||
bool /*flush_memtable*/ = true) override {
|
||||
return Status::NotSupported("Not supported in compacted db mode.");
|
||||
}
|
||||
using DBImpl::Flush;
|
||||
virtual Status Flush(const FlushOptions& options,
|
||||
ColumnFamilyHandle* column_family) override {
|
||||
virtual Status Flush(const FlushOptions& /*options*/,
|
||||
ColumnFamilyHandle* /*column_family*/) override {
|
||||
return Status::NotSupported("Not supported in compacted db mode.");
|
||||
}
|
||||
using DB::IngestExternalFile;
|
||||
virtual Status IngestExternalFile(
|
||||
ColumnFamilyHandle* column_family,
|
||||
const std::vector<std::string>& external_files,
|
||||
const IngestExternalFileOptions& ingestion_options) override {
|
||||
ColumnFamilyHandle* /*column_family*/,
|
||||
const std::vector<std::string>& /*external_files*/,
|
||||
const IngestExternalFileOptions& /*ingestion_options*/) override {
|
||||
return Status::NotSupported("Not supported in compacted db mode.");
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ CompactionIterator::CompactionIterator(
|
|||
|
||||
CompactionIterator::CompactionIterator(
|
||||
InternalIterator* input, const Comparator* cmp, MergeHelper* merge_helper,
|
||||
SequenceNumber last_sequence, std::vector<SequenceNumber>* snapshots,
|
||||
SequenceNumber /*last_sequence*/, std::vector<SequenceNumber>* snapshots,
|
||||
SequenceNumber earliest_write_conflict_snapshot,
|
||||
const SnapshotChecker* snapshot_checker, Env* env,
|
||||
bool expect_valid_internal_key, RangeDelAggregator* range_del_agg,
|
||||
|
@ -66,8 +66,7 @@ CompactionIterator::CompactionIterator(
|
|||
const CompactionFilter* compaction_filter,
|
||||
CompactionEventListener* compaction_listener,
|
||||
const std::atomic<bool>* shutting_down,
|
||||
const SequenceNumber preserve_deletes_seqnum
|
||||
)
|
||||
const SequenceNumber preserve_deletes_seqnum)
|
||||
: input_(input),
|
||||
cmp_(cmp),
|
||||
merge_helper_(merge_helper),
|
||||
|
|
|
@ -32,7 +32,7 @@ class CompactionIterator {
|
|||
: compaction_(compaction) {}
|
||||
|
||||
virtual ~CompactionProxy() = default;
|
||||
virtual int level(size_t compaction_input_level = 0) const {
|
||||
virtual int level(size_t /*compaction_input_level*/ = 0) const {
|
||||
return compaction_->level();
|
||||
}
|
||||
virtual bool KeyNotExistsBeyondOutputLevel(
|
||||
|
|
|
@ -19,15 +19,15 @@ namespace rocksdb {
|
|||
// Expects no merging attempts.
|
||||
class NoMergingMergeOp : public MergeOperator {
|
||||
public:
|
||||
bool FullMergeV2(const MergeOperationInput& merge_in,
|
||||
MergeOperationOutput* merge_out) const override {
|
||||
bool FullMergeV2(const MergeOperationInput& /*merge_in*/,
|
||||
MergeOperationOutput* /*merge_out*/) const override {
|
||||
ADD_FAILURE();
|
||||
return false;
|
||||
}
|
||||
bool PartialMergeMulti(const Slice& key,
|
||||
const std::deque<Slice>& operand_list,
|
||||
std::string* new_value,
|
||||
Logger* logger) const override {
|
||||
bool PartialMergeMulti(const Slice& /*key*/,
|
||||
const std::deque<Slice>& /*operand_list*/,
|
||||
std::string* /*new_value*/,
|
||||
Logger* /*logger*/) const override {
|
||||
ADD_FAILURE();
|
||||
return false;
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ class LoggingForwardVectorIterator : public InternalIterator {
|
|||
keys_.begin();
|
||||
}
|
||||
|
||||
virtual void SeekForPrev(const Slice& target) override { assert(false); }
|
||||
virtual void SeekForPrev(const Slice& /*target*/) override { assert(false); }
|
||||
|
||||
virtual void Next() override {
|
||||
assert(Valid());
|
||||
|
@ -158,9 +158,12 @@ class FakeCompaction : public CompactionIterator::CompactionProxy {
|
|||
public:
|
||||
FakeCompaction() = default;
|
||||
|
||||
virtual int level(size_t compaction_input_level) const override { return 0; }
|
||||
virtual int level(size_t /*compaction_input_level*/) const override {
|
||||
return 0;
|
||||
}
|
||||
virtual bool KeyNotExistsBeyondOutputLevel(
|
||||
const Slice& user_key, std::vector<size_t>* level_ptrs) const override {
|
||||
const Slice& /*user_key*/,
|
||||
std::vector<size_t>* /*level_ptrs*/) const override {
|
||||
return is_bottommost_level || key_not_exists_beyond_output_level;
|
||||
}
|
||||
virtual bool bottommost_level() const override { return is_bottommost_level; }
|
||||
|
@ -365,9 +368,9 @@ TEST_P(CompactionIteratorTest, RangeDeletionWithSnapshots) {
|
|||
|
||||
TEST_P(CompactionIteratorTest, CompactionFilterSkipUntil) {
|
||||
class Filter : public CompactionFilter {
|
||||
virtual Decision FilterV2(int level, const Slice& key, ValueType t,
|
||||
virtual Decision FilterV2(int /*level*/, const Slice& key, ValueType t,
|
||||
const Slice& existing_value,
|
||||
std::string* new_value,
|
||||
std::string* /*new_value*/,
|
||||
std::string* skip_until) const override {
|
||||
std::string k = key.ToString();
|
||||
std::string v = existing_value.ToString();
|
||||
|
@ -548,10 +551,10 @@ TEST_P(CompactionIteratorTest, ShuttingDownInMerge) {
|
|||
|
||||
TEST_P(CompactionIteratorTest, SingleMergeOperand) {
|
||||
class Filter : public CompactionFilter {
|
||||
virtual Decision FilterV2(int level, const Slice& key, ValueType t,
|
||||
virtual Decision FilterV2(int /*level*/, const Slice& key, ValueType t,
|
||||
const Slice& existing_value,
|
||||
std::string* new_value,
|
||||
std::string* skip_until) const override {
|
||||
std::string* /*new_value*/,
|
||||
std::string* /*skip_until*/) const override {
|
||||
std::string k = key.ToString();
|
||||
std::string v = existing_value.ToString();
|
||||
|
||||
|
@ -602,7 +605,7 @@ TEST_P(CompactionIteratorTest, SingleMergeOperand) {
|
|||
bool PartialMergeMulti(const Slice& key,
|
||||
const std::deque<Slice>& operand_list,
|
||||
std::string* new_value,
|
||||
Logger* logger) const override {
|
||||
Logger* /*logger*/) const override {
|
||||
std::string string_key = key.ToString();
|
||||
EXPECT_TRUE(string_key == "a" || string_key == "b");
|
||||
|
||||
|
|
|
@ -426,7 +426,7 @@ class CompactionJobStatsChecker : public EventListener {
|
|||
// Once a compaction completed, this function will verify the returned
|
||||
// CompactionJobInfo with the oldest CompactionJobInfo added earlier
|
||||
// in "expected_stats_" which has not yet being used for verification.
|
||||
virtual void OnCompactionCompleted(DB *db, const CompactionJobInfo& ci) {
|
||||
virtual void OnCompactionCompleted(DB* /*db*/, const CompactionJobInfo& ci) {
|
||||
if (verify_next_comp_io_stats_) {
|
||||
ASSERT_GT(ci.stats.file_write_nanos, 0);
|
||||
ASSERT_GT(ci.stats.file_range_sync_nanos, 0);
|
||||
|
|
|
@ -199,7 +199,7 @@ void CompactionPicker::GetRange(const std::vector<CompactionInputFiles>& inputs,
|
|||
assert(initialized);
|
||||
}
|
||||
|
||||
bool CompactionPicker::ExpandInputsToCleanCut(const std::string& cf_name,
|
||||
bool CompactionPicker::ExpandInputsToCleanCut(const std::string& /*cf_name*/,
|
||||
VersionStorageInfo* vstorage,
|
||||
CompactionInputFiles* inputs) {
|
||||
// This isn't good compaction
|
||||
|
@ -309,7 +309,7 @@ Compaction* CompactionPicker::CompactFiles(
|
|||
Status CompactionPicker::GetCompactionInputsFromFileNumbers(
|
||||
std::vector<CompactionInputFiles>* input_files,
|
||||
std::unordered_set<uint64_t>* input_set, const VersionStorageInfo* vstorage,
|
||||
const CompactionOptions& compact_options) const {
|
||||
const CompactionOptions& /*compact_options*/) const {
|
||||
if (input_set->size() == 0U) {
|
||||
return Status::InvalidArgument(
|
||||
"Compaction must include at least one file.");
|
||||
|
@ -1612,8 +1612,9 @@ Compaction* FIFOCompactionPicker::PickCompaction(
|
|||
Compaction* FIFOCompactionPicker::CompactRange(
|
||||
const std::string& cf_name, const MutableCFOptions& mutable_cf_options,
|
||||
VersionStorageInfo* vstorage, int input_level, int output_level,
|
||||
uint32_t output_path_id, const InternalKey* begin, const InternalKey* end,
|
||||
InternalKey** compaction_end, bool* manual_conflict) {
|
||||
uint32_t /*output_path_id*/, const InternalKey* /*begin*/,
|
||||
const InternalKey* /*end*/, InternalKey** compaction_end,
|
||||
bool* /*manual_conflict*/) {
|
||||
assert(input_level == 0);
|
||||
assert(output_level == 0);
|
||||
*compaction_end = nullptr;
|
||||
|
|
|
@ -267,27 +267,29 @@ class NullCompactionPicker : public CompactionPicker {
|
|||
virtual ~NullCompactionPicker() {}
|
||||
|
||||
// Always return "nullptr"
|
||||
Compaction* PickCompaction(const std::string& cf_name,
|
||||
const MutableCFOptions& mutable_cf_options,
|
||||
VersionStorageInfo* vstorage,
|
||||
LogBuffer* log_buffer) override {
|
||||
Compaction* PickCompaction(const std::string& /*cf_name*/,
|
||||
const MutableCFOptions& /*mutable_cf_options*/,
|
||||
VersionStorageInfo* /*vstorage*/,
|
||||
LogBuffer* /*log_buffer*/) override {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Always return "nullptr"
|
||||
Compaction* CompactRange(const std::string& cf_name,
|
||||
const MutableCFOptions& mutable_cf_options,
|
||||
VersionStorageInfo* vstorage, int input_level,
|
||||
int output_level, uint32_t output_path_id,
|
||||
const InternalKey* begin, const InternalKey* end,
|
||||
InternalKey** compaction_end,
|
||||
bool* manual_conflict) override {
|
||||
Compaction* CompactRange(const std::string& /*cf_name*/,
|
||||
const MutableCFOptions& /*mutable_cf_options*/,
|
||||
VersionStorageInfo* /*vstorage*/,
|
||||
int /*input_level*/, int /*output_level*/,
|
||||
uint32_t /*output_path_id*/,
|
||||
const InternalKey* /*begin*/,
|
||||
const InternalKey* /*end*/,
|
||||
InternalKey** /*compaction_end*/,
|
||||
bool* /*manual_conflict*/) override {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Always returns false.
|
||||
virtual bool NeedsCompaction(
|
||||
const VersionStorageInfo* vstorage) const override {
|
||||
const VersionStorageInfo* /*vstorage*/) const override {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -20,7 +20,9 @@ namespace rocksdb {
|
|||
class CountingLogger : public Logger {
|
||||
public:
|
||||
using Logger::Logv;
|
||||
virtual void Logv(const char* format, va_list ap) override { log_count++; }
|
||||
virtual void Logv(const char* /*format*/, va_list /*ap*/) override {
|
||||
log_count++;
|
||||
}
|
||||
size_t log_count;
|
||||
};
|
||||
|
||||
|
|
|
@ -204,7 +204,7 @@ void UniversalCompactionPicker::SortedRun::DumpSizeInfo(
|
|||
|
||||
std::vector<UniversalCompactionPicker::SortedRun>
|
||||
UniversalCompactionPicker::CalculateSortedRuns(
|
||||
const VersionStorageInfo& vstorage, const ImmutableCFOptions& ioptions,
|
||||
const VersionStorageInfo& vstorage, const ImmutableCFOptions& /*ioptions*/,
|
||||
const MutableCFOptions& mutable_cf_options) {
|
||||
std::vector<UniversalCompactionPicker::SortedRun> ret;
|
||||
for (FileMetaData* f : vstorage.LevelFiles(0)) {
|
||||
|
|
|
@ -188,10 +188,10 @@ class DoubleComparator : public Comparator {
|
|||
return -1;
|
||||
}
|
||||
}
|
||||
virtual void FindShortestSeparator(std::string* start,
|
||||
const Slice& limit) const override {}
|
||||
virtual void FindShortestSeparator(std::string* /*start*/,
|
||||
const Slice& /*limit*/) const override {}
|
||||
|
||||
virtual void FindShortSuccessor(std::string* key) const override {}
|
||||
virtual void FindShortSuccessor(std::string* /*key*/) const override {}
|
||||
};
|
||||
|
||||
class HashComparator : public Comparator {
|
||||
|
@ -211,10 +211,10 @@ class HashComparator : public Comparator {
|
|||
return -1;
|
||||
}
|
||||
}
|
||||
virtual void FindShortestSeparator(std::string* start,
|
||||
const Slice& limit) const override {}
|
||||
virtual void FindShortestSeparator(std::string* /*start*/,
|
||||
const Slice& /*limit*/) const override {}
|
||||
|
||||
virtual void FindShortSuccessor(std::string* key) const override {}
|
||||
virtual void FindShortSuccessor(std::string* /*key*/) const override {}
|
||||
};
|
||||
|
||||
class TwoStrComparator : public Comparator {
|
||||
|
@ -243,10 +243,10 @@ class TwoStrComparator : public Comparator {
|
|||
}
|
||||
return a2.compare(b2);
|
||||
}
|
||||
virtual void FindShortestSeparator(std::string* start,
|
||||
const Slice& limit) const override {}
|
||||
virtual void FindShortestSeparator(std::string* /*start*/,
|
||||
const Slice& /*limit*/) const override {}
|
||||
|
||||
virtual void FindShortSuccessor(std::string* key) const override {}
|
||||
virtual void FindShortSuccessor(std::string* /*key*/) const override {}
|
||||
};
|
||||
} // namespace
|
||||
|
||||
|
|
|
@ -855,14 +855,15 @@ class TestEnv : public EnvWrapper {
|
|||
class TestLogger : public Logger {
|
||||
public:
|
||||
using Logger::Logv;
|
||||
virtual void Logv(const char *format, va_list ap) override { };
|
||||
private:
|
||||
virtual void Logv(const char* /*format*/, va_list /*ap*/) override{};
|
||||
|
||||
private:
|
||||
virtual Status CloseImpl() override {
|
||||
return Status::NotSupported();
|
||||
}
|
||||
};
|
||||
|
||||
virtual Status NewLogger(const std::string& fname,
|
||||
virtual Status NewLogger(const std::string& /*fname*/,
|
||||
shared_ptr<Logger>* result) {
|
||||
result->reset(new TestLogger());
|
||||
return Status::OK();
|
||||
|
|
|
@ -47,7 +47,7 @@ class DBBlockCacheTest : public DBTestBase {
|
|||
return options;
|
||||
}
|
||||
|
||||
void InitTable(const Options& options) {
|
||||
void InitTable(const Options& /*options*/) {
|
||||
std::string value(kValueSize, 'a');
|
||||
for (size_t i = 0; i < kNumBlocks; i++) {
|
||||
ASSERT_OK(Put(ToString(i), value.c_str()));
|
||||
|
|
|
@ -56,9 +56,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||
|
||||
class KeepFilter : public CompactionFilter {
|
||||
public:
|
||||
virtual bool Filter(int level, const Slice& key, const Slice& value,
|
||||
std::string* new_value, bool* value_changed) const
|
||||
override {
|
||||
virtual bool Filter(int /*level*/, const Slice& /*key*/,
|
||||
const Slice& /*value*/, std::string* /*new_value*/,
|
||||
bool* /*value_changed*/) const override {
|
||||
cfilter_count++;
|
||||
return false;
|
||||
}
|
||||
|
@ -68,9 +68,9 @@ class KeepFilter : public CompactionFilter {
|
|||
|
||||
class DeleteFilter : public CompactionFilter {
|
||||
public:
|
||||
virtual bool Filter(int level, const Slice& key, const Slice& value,
|
||||
std::string* new_value, bool* value_changed) const
|
||||
override {
|
||||
virtual bool Filter(int /*level*/, const Slice& /*key*/,
|
||||
const Slice& /*value*/, std::string* /*new_value*/,
|
||||
bool* /*value_changed*/) const override {
|
||||
cfilter_count++;
|
||||
return true;
|
||||
}
|
||||
|
@ -80,9 +80,9 @@ class DeleteFilter : public CompactionFilter {
|
|||
|
||||
class DeleteISFilter : public CompactionFilter {
|
||||
public:
|
||||
virtual bool Filter(int level, const Slice& key, const Slice& value,
|
||||
std::string* new_value,
|
||||
bool* value_changed) const override {
|
||||
virtual bool Filter(int /*level*/, const Slice& key, const Slice& /*value*/,
|
||||
std::string* /*new_value*/,
|
||||
bool* /*value_changed*/) const override {
|
||||
cfilter_count++;
|
||||
int i = std::stoi(key.ToString());
|
||||
if (i > 5 && i <= 105) {
|
||||
|
@ -100,8 +100,10 @@ class DeleteISFilter : public CompactionFilter {
|
|||
// zero-padded to length 10.
|
||||
class SkipEvenFilter : public CompactionFilter {
|
||||
public:
|
||||
virtual Decision FilterV2(int level, const Slice& key, ValueType value_type,
|
||||
const Slice& existing_value, std::string* new_value,
|
||||
virtual Decision FilterV2(int /*level*/, const Slice& key,
|
||||
ValueType /*value_type*/,
|
||||
const Slice& /*existing_value*/,
|
||||
std::string* /*new_value*/,
|
||||
std::string* skip_until) const override {
|
||||
cfilter_count++;
|
||||
int i = std::stoi(key.ToString());
|
||||
|
@ -123,9 +125,9 @@ class SkipEvenFilter : public CompactionFilter {
|
|||
class DelayFilter : public CompactionFilter {
|
||||
public:
|
||||
explicit DelayFilter(DBTestBase* d) : db_test(d) {}
|
||||
virtual bool Filter(int level, const Slice& key, const Slice& value,
|
||||
std::string* new_value,
|
||||
bool* value_changed) const override {
|
||||
virtual bool Filter(int /*level*/, const Slice& /*key*/,
|
||||
const Slice& /*value*/, std::string* /*new_value*/,
|
||||
bool* /*value_changed*/) const override {
|
||||
db_test->env_->addon_time_.fetch_add(1000);
|
||||
return true;
|
||||
}
|
||||
|
@ -140,9 +142,9 @@ class ConditionalFilter : public CompactionFilter {
|
|||
public:
|
||||
explicit ConditionalFilter(const std::string* filtered_value)
|
||||
: filtered_value_(filtered_value) {}
|
||||
virtual bool Filter(int level, const Slice& key, const Slice& value,
|
||||
std::string* new_value,
|
||||
bool* value_changed) const override {
|
||||
virtual bool Filter(int /*level*/, const Slice& /*key*/, const Slice& value,
|
||||
std::string* /*new_value*/,
|
||||
bool* /*value_changed*/) const override {
|
||||
return value.ToString() == *filtered_value_;
|
||||
}
|
||||
|
||||
|
@ -156,9 +158,9 @@ class ChangeFilter : public CompactionFilter {
|
|||
public:
|
||||
explicit ChangeFilter() {}
|
||||
|
||||
virtual bool Filter(int level, const Slice& key, const Slice& value,
|
||||
std::string* new_value, bool* value_changed) const
|
||||
override {
|
||||
virtual bool Filter(int /*level*/, const Slice& /*key*/,
|
||||
const Slice& /*value*/, std::string* new_value,
|
||||
bool* value_changed) const override {
|
||||
assert(new_value != nullptr);
|
||||
*new_value = NEW_VALUE;
|
||||
*value_changed = true;
|
||||
|
@ -247,7 +249,7 @@ class DelayFilterFactory : public CompactionFilterFactory {
|
|||
public:
|
||||
explicit DelayFilterFactory(DBTestBase* d) : db_test(d) {}
|
||||
virtual std::unique_ptr<CompactionFilter> CreateCompactionFilter(
|
||||
const CompactionFilter::Context& context) override {
|
||||
const CompactionFilter::Context& /*context*/) override {
|
||||
return std::unique_ptr<CompactionFilter>(new DelayFilter(db_test));
|
||||
}
|
||||
|
||||
|
@ -263,7 +265,7 @@ class ConditionalFilterFactory : public CompactionFilterFactory {
|
|||
: filtered_value_(filtered_value.ToString()) {}
|
||||
|
||||
virtual std::unique_ptr<CompactionFilter> CreateCompactionFilter(
|
||||
const CompactionFilter::Context& context) override {
|
||||
const CompactionFilter::Context& /*context*/) override {
|
||||
return std::unique_ptr<CompactionFilter>(
|
||||
new ConditionalFilter(&filtered_value_));
|
||||
}
|
||||
|
@ -281,7 +283,7 @@ class ChangeFilterFactory : public CompactionFilterFactory {
|
|||
explicit ChangeFilterFactory() {}
|
||||
|
||||
virtual std::unique_ptr<CompactionFilter> CreateCompactionFilter(
|
||||
const CompactionFilter::Context& context) override {
|
||||
const CompactionFilter::Context& /*context*/) override {
|
||||
return std::unique_ptr<CompactionFilter>(new ChangeFilter());
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ class FlushedFileCollector : public EventListener {
|
|||
FlushedFileCollector() {}
|
||||
~FlushedFileCollector() {}
|
||||
|
||||
virtual void OnFlushCompleted(DB* db, const FlushJobInfo& info) override {
|
||||
virtual void OnFlushCompleted(DB* /*db*/, const FlushJobInfo& info) override {
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
flushed_files_.push_back(info.file_path);
|
||||
}
|
||||
|
|
|
@ -666,8 +666,9 @@ Status DBImpl::SetDBOptions(
|
|||
}
|
||||
|
||||
// return the same level if it cannot be moved
|
||||
int DBImpl::FindMinimumEmptyLevelFitting(ColumnFamilyData* cfd,
|
||||
const MutableCFOptions& mutable_cf_options, int level) {
|
||||
int DBImpl::FindMinimumEmptyLevelFitting(
|
||||
ColumnFamilyData* cfd, const MutableCFOptions& /*mutable_cf_options*/,
|
||||
int level) {
|
||||
mutex_.AssertHeld();
|
||||
const auto* vstorage = cfd->current()->storage_info();
|
||||
int minimum_level = level;
|
||||
|
@ -888,7 +889,7 @@ struct IterState {
|
|||
bool background_purge;
|
||||
};
|
||||
|
||||
static void CleanupIteratorState(void* arg1, void* arg2) {
|
||||
static void CleanupIteratorState(void* arg1, void* /*arg2*/) {
|
||||
IterState* state = reinterpret_cast<IterState*>(arg1);
|
||||
|
||||
if (state->super_version->Unref()) {
|
||||
|
@ -2326,31 +2327,31 @@ Status DBImpl::GetDbIdentity(std::string& identity) const {
|
|||
}
|
||||
|
||||
// Default implementation -- returns not supported status
|
||||
Status DB::CreateColumnFamily(const ColumnFamilyOptions& cf_options,
|
||||
const std::string& column_family_name,
|
||||
ColumnFamilyHandle** handle) {
|
||||
Status DB::CreateColumnFamily(const ColumnFamilyOptions& /*cf_options*/,
|
||||
const std::string& /*column_family_name*/,
|
||||
ColumnFamilyHandle** /*handle*/) {
|
||||
return Status::NotSupported("");
|
||||
}
|
||||
|
||||
Status DB::CreateColumnFamilies(
|
||||
const ColumnFamilyOptions& cf_options,
|
||||
const std::vector<std::string>& column_family_names,
|
||||
std::vector<ColumnFamilyHandle*>* handles) {
|
||||
const ColumnFamilyOptions& /*cf_options*/,
|
||||
const std::vector<std::string>& /*column_family_names*/,
|
||||
std::vector<ColumnFamilyHandle*>* /*handles*/) {
|
||||
return Status::NotSupported("");
|
||||
}
|
||||
|
||||
Status DB::CreateColumnFamilies(
|
||||
const std::vector<ColumnFamilyDescriptor>& column_families,
|
||||
std::vector<ColumnFamilyHandle*>* handles) {
|
||||
const std::vector<ColumnFamilyDescriptor>& /*column_families*/,
|
||||
std::vector<ColumnFamilyHandle*>* /*handles*/) {
|
||||
return Status::NotSupported("");
|
||||
}
|
||||
|
||||
Status DB::DropColumnFamily(ColumnFamilyHandle* column_family) {
|
||||
Status DB::DropColumnFamily(ColumnFamilyHandle* /*column_family*/) {
|
||||
return Status::NotSupported("");
|
||||
}
|
||||
|
||||
Status DB::DropColumnFamilies(
|
||||
const std::vector<ColumnFamilyHandle*>& column_families) {
|
||||
const std::vector<ColumnFamilyHandle*>& /*column_families*/) {
|
||||
return Status::NotSupported("");
|
||||
}
|
||||
|
||||
|
|
|
@ -854,7 +854,7 @@ int DBImpl::NumberLevels(ColumnFamilyHandle* column_family) {
|
|||
return cfh->cfd()->NumberLevels();
|
||||
}
|
||||
|
||||
int DBImpl::MaxMemCompactionLevel(ColumnFamilyHandle* column_family) {
|
||||
int DBImpl::MaxMemCompactionLevel(ColumnFamilyHandle* /*column_family*/) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ Status DBImplReadOnly::NewIterators(
|
|||
}
|
||||
|
||||
Status DB::OpenForReadOnly(const Options& options, const std::string& dbname,
|
||||
DB** dbptr, bool error_if_log_file_exist) {
|
||||
DB** dbptr, bool /*error_if_log_file_exist*/) {
|
||||
*dbptr = nullptr;
|
||||
|
||||
// Try to first open DB as fully compacted DB
|
||||
|
|
|
@ -36,46 +36,47 @@ class DBImplReadOnly : public DBImpl {
|
|||
std::vector<Iterator*>* iterators) override;
|
||||
|
||||
using DBImpl::Put;
|
||||
virtual Status Put(const WriteOptions& options,
|
||||
ColumnFamilyHandle* column_family, const Slice& key,
|
||||
const Slice& value) override {
|
||||
virtual Status Put(const WriteOptions& /*options*/,
|
||||
ColumnFamilyHandle* /*column_family*/,
|
||||
const Slice& /*key*/, const Slice& /*value*/) override {
|
||||
return Status::NotSupported("Not supported operation in read only mode.");
|
||||
}
|
||||
using DBImpl::Merge;
|
||||
virtual Status Merge(const WriteOptions& options,
|
||||
ColumnFamilyHandle* column_family, const Slice& key,
|
||||
const Slice& value) override {
|
||||
virtual Status Merge(const WriteOptions& /*options*/,
|
||||
ColumnFamilyHandle* /*column_family*/,
|
||||
const Slice& /*key*/, const Slice& /*value*/) override {
|
||||
return Status::NotSupported("Not supported operation in read only mode.");
|
||||
}
|
||||
using DBImpl::Delete;
|
||||
virtual Status Delete(const WriteOptions& options,
|
||||
ColumnFamilyHandle* column_family,
|
||||
const Slice& key) override {
|
||||
virtual Status Delete(const WriteOptions& /*options*/,
|
||||
ColumnFamilyHandle* /*column_family*/,
|
||||
const Slice& /*key*/) override {
|
||||
return Status::NotSupported("Not supported operation in read only mode.");
|
||||
}
|
||||
using DBImpl::SingleDelete;
|
||||
virtual Status SingleDelete(const WriteOptions& options,
|
||||
ColumnFamilyHandle* column_family,
|
||||
const Slice& key) override {
|
||||
virtual Status SingleDelete(const WriteOptions& /*options*/,
|
||||
ColumnFamilyHandle* /*column_family*/,
|
||||
const Slice& /*key*/) override {
|
||||
return Status::NotSupported("Not supported operation in read only mode.");
|
||||
}
|
||||
virtual Status Write(const WriteOptions& options,
|
||||
WriteBatch* updates) override {
|
||||
virtual Status Write(const WriteOptions& /*options*/,
|
||||
WriteBatch* /*updates*/) override {
|
||||
return Status::NotSupported("Not supported operation in read only mode.");
|
||||
}
|
||||
using DBImpl::CompactRange;
|
||||
virtual Status CompactRange(const CompactRangeOptions& options,
|
||||
ColumnFamilyHandle* column_family,
|
||||
const Slice* begin, const Slice* end) override {
|
||||
virtual Status CompactRange(const CompactRangeOptions& /*options*/,
|
||||
ColumnFamilyHandle* /*column_family*/,
|
||||
const Slice* /*begin*/,
|
||||
const Slice* /*end*/) override {
|
||||
return Status::NotSupported("Not supported operation in read only mode.");
|
||||
}
|
||||
|
||||
using DBImpl::CompactFiles;
|
||||
virtual Status CompactFiles(
|
||||
const CompactionOptions& compact_options,
|
||||
ColumnFamilyHandle* column_family,
|
||||
const std::vector<std::string>& input_file_names,
|
||||
const int output_level, const int output_path_id = -1) override {
|
||||
const CompactionOptions& /*compact_options*/,
|
||||
ColumnFamilyHandle* /*column_family*/,
|
||||
const std::vector<std::string>& /*input_file_names*/,
|
||||
const int /*output_level*/, const int /*output_path_id*/ = -1) override {
|
||||
return Status::NotSupported("Not supported operation in read only mode.");
|
||||
}
|
||||
|
||||
|
@ -83,18 +84,18 @@ class DBImplReadOnly : public DBImpl {
|
|||
return Status::NotSupported("Not supported operation in read only mode.");
|
||||
}
|
||||
|
||||
virtual Status EnableFileDeletions(bool force) override {
|
||||
virtual Status EnableFileDeletions(bool /*force*/) override {
|
||||
return Status::NotSupported("Not supported operation in read only mode.");
|
||||
}
|
||||
virtual Status GetLiveFiles(std::vector<std::string>&,
|
||||
uint64_t* manifest_file_size,
|
||||
bool flush_memtable = true) override {
|
||||
uint64_t* /*manifest_file_size*/,
|
||||
bool /*flush_memtable*/ = true) override {
|
||||
return Status::NotSupported("Not supported operation in read only mode.");
|
||||
}
|
||||
|
||||
using DBImpl::Flush;
|
||||
virtual Status Flush(const FlushOptions& options,
|
||||
ColumnFamilyHandle* column_family) override {
|
||||
virtual Status Flush(const FlushOptions& /*options*/,
|
||||
ColumnFamilyHandle* /*column_family*/) override {
|
||||
return Status::NotSupported("Not supported operation in read only mode.");
|
||||
}
|
||||
|
||||
|
@ -105,9 +106,9 @@ class DBImplReadOnly : public DBImpl {
|
|||
|
||||
using DB::IngestExternalFile;
|
||||
virtual Status IngestExternalFile(
|
||||
ColumnFamilyHandle* column_family,
|
||||
const std::vector<std::string>& external_files,
|
||||
const IngestExternalFileOptions& ingestion_options) override {
|
||||
ColumnFamilyHandle* /*column_family*/,
|
||||
const std::vector<std::string>& /*external_files*/,
|
||||
const IngestExternalFileOptions& /*ingestion_options*/) override {
|
||||
return Status::NotSupported("Not supported operation in read only mode.");
|
||||
}
|
||||
|
||||
|
|
|
@ -1175,7 +1175,7 @@ Status DBImpl::ScheduleFlushes(WriteContext* context) {
|
|||
}
|
||||
|
||||
#ifndef ROCKSDB_LITE
|
||||
void DBImpl::NotifyOnMemTableSealed(ColumnFamilyData* cfd,
|
||||
void DBImpl::NotifyOnMemTableSealed(ColumnFamilyData* /*cfd*/,
|
||||
const MemTableInfo& mem_table_info) {
|
||||
if (immutable_db_options_.listeners.size() == 0U) {
|
||||
return;
|
||||
|
|
|
@ -50,7 +50,7 @@ class DBIteratorTest : public DBTestBase,
|
|||
|
||||
class FlushBlockEveryKeyPolicy : public FlushBlockPolicy {
|
||||
public:
|
||||
virtual bool Update(const Slice& key, const Slice& value) override {
|
||||
virtual bool Update(const Slice& /*key*/, const Slice& /*value*/) override {
|
||||
if (!start_) {
|
||||
start_ = true;
|
||||
return false;
|
||||
|
@ -70,8 +70,8 @@ class FlushBlockEveryKeyPolicyFactory : public FlushBlockPolicyFactory {
|
|||
}
|
||||
|
||||
FlushBlockPolicy* NewFlushBlockPolicy(
|
||||
const BlockBasedTableOptions& table_options,
|
||||
const BlockBuilder& data_block_builder) const override {
|
||||
const BlockBasedTableOptions& /*table_options*/,
|
||||
const BlockBuilder& /*data_block_builder*/) const override {
|
||||
return new FlushBlockEveryKeyPolicy;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -119,7 +119,7 @@ class TestPrefixExtractor : public SliceTransform {
|
|||
return separator(key) != nullptr;
|
||||
}
|
||||
|
||||
virtual bool InRange(const Slice& key) const override { return false; }
|
||||
virtual bool InRange(const Slice& /*key*/) const override { return false; }
|
||||
|
||||
private:
|
||||
const char* separator(const Slice& key) const {
|
||||
|
|
|
@ -985,8 +985,9 @@ class CountingUserTblPropCollector : public TablePropertiesCollector {
|
|||
return Status::OK();
|
||||
}
|
||||
|
||||
Status AddUserKey(const Slice& user_key, const Slice& value, EntryType type,
|
||||
SequenceNumber seq, uint64_t file_size) override {
|
||||
Status AddUserKey(const Slice& /*user_key*/, const Slice& /*value*/,
|
||||
EntryType /*type*/, SequenceNumber /*seq*/,
|
||||
uint64_t /*file_size*/) override {
|
||||
++count_;
|
||||
return Status::OK();
|
||||
}
|
||||
|
@ -1027,8 +1028,9 @@ class CountingDeleteTabPropCollector : public TablePropertiesCollector {
|
|||
public:
|
||||
const char* Name() const override { return "CountingDeleteTabPropCollector"; }
|
||||
|
||||
Status AddUserKey(const Slice& user_key, const Slice& value, EntryType type,
|
||||
SequenceNumber seq, uint64_t file_size) override {
|
||||
Status AddUserKey(const Slice& /*user_key*/, const Slice& /*value*/,
|
||||
EntryType type, SequenceNumber /*seq*/,
|
||||
uint64_t /*file_size*/) override {
|
||||
if (type == kEntryDelete) {
|
||||
num_deletes_++;
|
||||
}
|
||||
|
@ -1055,7 +1057,7 @@ class CountingDeleteTabPropCollectorFactory
|
|||
: public TablePropertiesCollectorFactory {
|
||||
public:
|
||||
virtual TablePropertiesCollector* CreateTablePropertiesCollector(
|
||||
TablePropertiesCollectorFactory::Context context) override {
|
||||
TablePropertiesCollectorFactory::Context /*context*/) override {
|
||||
return new CountingDeleteTabPropCollector();
|
||||
}
|
||||
const char* Name() const override {
|
||||
|
|
152
db/db_test.cc
152
db/db_test.cc
|
@ -750,9 +750,9 @@ TEST_F(DBTest, FlushSchedule) {
|
|||
namespace {
|
||||
class KeepFilter : public CompactionFilter {
|
||||
public:
|
||||
virtual bool Filter(int level, const Slice& key, const Slice& value,
|
||||
std::string* new_value,
|
||||
bool* value_changed) const override {
|
||||
virtual bool Filter(int /*level*/, const Slice& /*key*/,
|
||||
const Slice& /*value*/, std::string* /*new_value*/,
|
||||
bool* /*value_changed*/) const override {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -782,9 +782,9 @@ class KeepFilterFactory : public CompactionFilterFactory {
|
|||
class DelayFilter : public CompactionFilter {
|
||||
public:
|
||||
explicit DelayFilter(DBTestBase* d) : db_test(d) {}
|
||||
virtual bool Filter(int level, const Slice& key, const Slice& value,
|
||||
std::string* new_value,
|
||||
bool* value_changed) const override {
|
||||
virtual bool Filter(int /*level*/, const Slice& /*key*/,
|
||||
const Slice& /*value*/, std::string* /*new_value*/,
|
||||
bool* /*value_changed*/) const override {
|
||||
db_test->env_->addon_time_.fetch_add(1000);
|
||||
return true;
|
||||
}
|
||||
|
@ -799,7 +799,7 @@ class DelayFilterFactory : public CompactionFilterFactory {
|
|||
public:
|
||||
explicit DelayFilterFactory(DBTestBase* d) : db_test(d) {}
|
||||
virtual std::unique_ptr<CompactionFilter> CreateCompactionFilter(
|
||||
const CompactionFilter::Context& context) override {
|
||||
const CompactionFilter::Context& /*context*/) override {
|
||||
return std::unique_ptr<CompactionFilter>(new DelayFilter(db_test));
|
||||
}
|
||||
|
||||
|
@ -2247,17 +2247,17 @@ class ModelDB : public DB {
|
|||
return Write(o, &batch);
|
||||
}
|
||||
using DB::Get;
|
||||
virtual Status Get(const ReadOptions& options, ColumnFamilyHandle* cf,
|
||||
const Slice& key, PinnableSlice* value) override {
|
||||
virtual Status Get(const ReadOptions& /*options*/, ColumnFamilyHandle* /*cf*/,
|
||||
const Slice& key, PinnableSlice* /*value*/) override {
|
||||
return Status::NotSupported(key);
|
||||
}
|
||||
|
||||
using DB::MultiGet;
|
||||
virtual std::vector<Status> MultiGet(
|
||||
const ReadOptions& options,
|
||||
const std::vector<ColumnFamilyHandle*>& column_family,
|
||||
const ReadOptions& /*options*/,
|
||||
const std::vector<ColumnFamilyHandle*>& /*column_family*/,
|
||||
const std::vector<Slice>& keys,
|
||||
std::vector<std::string>* values) override {
|
||||
std::vector<std::string>* /*values*/) override {
|
||||
std::vector<Status> s(keys.size(),
|
||||
Status::NotSupported("Not implemented."));
|
||||
return s;
|
||||
|
@ -2266,9 +2266,9 @@ class ModelDB : public DB {
|
|||
#ifndef ROCKSDB_LITE
|
||||
using DB::IngestExternalFile;
|
||||
virtual Status IngestExternalFile(
|
||||
ColumnFamilyHandle* column_family,
|
||||
const std::vector<std::string>& external_files,
|
||||
const IngestExternalFileOptions& options) override {
|
||||
ColumnFamilyHandle* /*column_family*/,
|
||||
const std::vector<std::string>& /*external_files*/,
|
||||
const IngestExternalFileOptions& /*options*/) override {
|
||||
return Status::NotSupported("Not implemented.");
|
||||
}
|
||||
|
||||
|
@ -2278,22 +2278,22 @@ class ModelDB : public DB {
|
|||
|
||||
using DB::GetPropertiesOfAllTables;
|
||||
virtual Status GetPropertiesOfAllTables(
|
||||
ColumnFamilyHandle* column_family,
|
||||
TablePropertiesCollection* props) override {
|
||||
ColumnFamilyHandle* /*column_family*/,
|
||||
TablePropertiesCollection* /*props*/) override {
|
||||
return Status();
|
||||
}
|
||||
|
||||
virtual Status GetPropertiesOfTablesInRange(
|
||||
ColumnFamilyHandle* column_family, const Range* range, std::size_t n,
|
||||
TablePropertiesCollection* props) override {
|
||||
ColumnFamilyHandle* /*column_family*/, const Range* /*range*/,
|
||||
std::size_t /*n*/, TablePropertiesCollection* /*props*/) override {
|
||||
return Status();
|
||||
}
|
||||
#endif // ROCKSDB_LITE
|
||||
|
||||
using DB::KeyMayExist;
|
||||
virtual bool KeyMayExist(const ReadOptions& options,
|
||||
ColumnFamilyHandle* column_family, const Slice& key,
|
||||
std::string* value,
|
||||
virtual bool KeyMayExist(const ReadOptions& /*options*/,
|
||||
ColumnFamilyHandle* /*column_family*/,
|
||||
const Slice& /*key*/, std::string* /*value*/,
|
||||
bool* value_found = nullptr) override {
|
||||
if (value_found != nullptr) {
|
||||
*value_found = false;
|
||||
|
@ -2301,8 +2301,9 @@ class ModelDB : public DB {
|
|||
return true; // Not Supported directly
|
||||
}
|
||||
using DB::NewIterator;
|
||||
virtual Iterator* NewIterator(const ReadOptions& options,
|
||||
ColumnFamilyHandle* column_family) override {
|
||||
virtual Iterator* NewIterator(
|
||||
const ReadOptions& options,
|
||||
ColumnFamilyHandle* /*column_family*/) override {
|
||||
if (options.snapshot == nullptr) {
|
||||
KVMap* saved = new KVMap;
|
||||
*saved = map_;
|
||||
|
@ -2314,9 +2315,9 @@ class ModelDB : public DB {
|
|||
}
|
||||
}
|
||||
virtual Status NewIterators(
|
||||
const ReadOptions& options,
|
||||
const std::vector<ColumnFamilyHandle*>& column_family,
|
||||
std::vector<Iterator*>* iterators) override {
|
||||
const ReadOptions& /*options*/,
|
||||
const std::vector<ColumnFamilyHandle*>& /*column_family*/,
|
||||
std::vector<Iterator*>* /*iterators*/) override {
|
||||
return Status::NotSupported("Not supported yet");
|
||||
}
|
||||
virtual const Snapshot* GetSnapshot() override {
|
||||
|
@ -2329,7 +2330,7 @@ class ModelDB : public DB {
|
|||
delete reinterpret_cast<const ModelSnapshot*>(snapshot);
|
||||
}
|
||||
|
||||
virtual Status Write(const WriteOptions& options,
|
||||
virtual Status Write(const WriteOptions& /*options*/,
|
||||
WriteBatch* batch) override {
|
||||
class Handler : public WriteBatch::Handler {
|
||||
public:
|
||||
|
@ -2337,7 +2338,8 @@ class ModelDB : public DB {
|
|||
virtual void Put(const Slice& key, const Slice& value) override {
|
||||
(*map_)[key.ToString()] = value.ToString();
|
||||
}
|
||||
virtual void Merge(const Slice& key, const Slice& value) override {
|
||||
virtual void Merge(const Slice& /*key*/,
|
||||
const Slice& /*value*/) override {
|
||||
// ignore merge for now
|
||||
// (*map_)[key.ToString()] = value.ToString();
|
||||
}
|
||||
|
@ -2351,62 +2353,65 @@ class ModelDB : public DB {
|
|||
}
|
||||
|
||||
using DB::GetProperty;
|
||||
virtual bool GetProperty(ColumnFamilyHandle* column_family,
|
||||
const Slice& property, std::string* value) override {
|
||||
virtual bool GetProperty(ColumnFamilyHandle* /*column_family*/,
|
||||
const Slice& /*property*/,
|
||||
std::string* /*value*/) override {
|
||||
return false;
|
||||
}
|
||||
using DB::GetIntProperty;
|
||||
virtual bool GetIntProperty(ColumnFamilyHandle* column_family,
|
||||
const Slice& property, uint64_t* value) override {
|
||||
virtual bool GetIntProperty(ColumnFamilyHandle* /*column_family*/,
|
||||
const Slice& /*property*/,
|
||||
uint64_t* /*value*/) override {
|
||||
return false;
|
||||
}
|
||||
using DB::GetMapProperty;
|
||||
virtual bool GetMapProperty(
|
||||
ColumnFamilyHandle* column_family, const Slice& property,
|
||||
std::map<std::string, std::string>* value) override {
|
||||
ColumnFamilyHandle* /*column_family*/, const Slice& /*property*/,
|
||||
std::map<std::string, std::string>* /*value*/) override {
|
||||
return false;
|
||||
}
|
||||
using DB::GetAggregatedIntProperty;
|
||||
virtual bool GetAggregatedIntProperty(const Slice& property,
|
||||
uint64_t* value) override {
|
||||
virtual bool GetAggregatedIntProperty(const Slice& /*property*/,
|
||||
uint64_t* /*value*/) override {
|
||||
return false;
|
||||
}
|
||||
using DB::GetApproximateSizes;
|
||||
virtual void GetApproximateSizes(ColumnFamilyHandle* column_family,
|
||||
const Range* range, int n, uint64_t* sizes,
|
||||
uint8_t include_flags
|
||||
virtual void GetApproximateSizes(ColumnFamilyHandle* /*column_family*/,
|
||||
const Range* /*range*/, int n,
|
||||
uint64_t* sizes,
|
||||
uint8_t /*include_flags*/
|
||||
= INCLUDE_FILES) override {
|
||||
for (int i = 0; i < n; i++) {
|
||||
sizes[i] = 0;
|
||||
}
|
||||
}
|
||||
using DB::GetApproximateMemTableStats;
|
||||
virtual void GetApproximateMemTableStats(ColumnFamilyHandle* column_family,
|
||||
const Range& range,
|
||||
uint64_t* const count,
|
||||
uint64_t* const size) override {
|
||||
virtual void GetApproximateMemTableStats(
|
||||
ColumnFamilyHandle* /*column_family*/, const Range& /*range*/,
|
||||
uint64_t* const count, uint64_t* const size) override {
|
||||
*count = 0;
|
||||
*size = 0;
|
||||
}
|
||||
using DB::CompactRange;
|
||||
virtual Status CompactRange(const CompactRangeOptions& options,
|
||||
ColumnFamilyHandle* column_family,
|
||||
const Slice* start, const Slice* end) override {
|
||||
virtual Status CompactRange(const CompactRangeOptions& /*options*/,
|
||||
ColumnFamilyHandle* /*column_family*/,
|
||||
const Slice* /*start*/,
|
||||
const Slice* /*end*/) override {
|
||||
return Status::NotSupported("Not supported operation.");
|
||||
}
|
||||
|
||||
virtual Status SetDBOptions(
|
||||
const std::unordered_map<std::string, std::string>& new_options)
|
||||
const std::unordered_map<std::string, std::string>& /*new_options*/)
|
||||
override {
|
||||
return Status::NotSupported("Not supported operation.");
|
||||
}
|
||||
|
||||
using DB::CompactFiles;
|
||||
virtual Status CompactFiles(const CompactionOptions& compact_options,
|
||||
ColumnFamilyHandle* column_family,
|
||||
const std::vector<std::string>& input_file_names,
|
||||
const int output_level,
|
||||
const int output_path_id = -1) override {
|
||||
virtual Status CompactFiles(
|
||||
const CompactionOptions& /*compact_options*/,
|
||||
ColumnFamilyHandle* /*column_family*/,
|
||||
const std::vector<std::string>& /*input_file_names*/,
|
||||
const int /*output_level*/, const int /*output_path_id*/ = -1) override {
|
||||
return Status::NotSupported("Not supported operation.");
|
||||
}
|
||||
|
||||
|
@ -2419,24 +2424,25 @@ class ModelDB : public DB {
|
|||
}
|
||||
|
||||
Status EnableAutoCompaction(
|
||||
const std::vector<ColumnFamilyHandle*>& column_family_handles) override {
|
||||
const std::vector<ColumnFamilyHandle*>& /*column_family_handles*/)
|
||||
override {
|
||||
return Status::NotSupported("Not supported operation.");
|
||||
}
|
||||
|
||||
using DB::NumberLevels;
|
||||
virtual int NumberLevels(ColumnFamilyHandle* column_family) override {
|
||||
virtual int NumberLevels(ColumnFamilyHandle* /*column_family*/) override {
|
||||
return 1;
|
||||
}
|
||||
|
||||
using DB::MaxMemCompactionLevel;
|
||||
virtual int MaxMemCompactionLevel(
|
||||
ColumnFamilyHandle* column_family) override {
|
||||
ColumnFamilyHandle* /*column_family*/) override {
|
||||
return 1;
|
||||
}
|
||||
|
||||
using DB::Level0StopWriteTrigger;
|
||||
virtual int Level0StopWriteTrigger(
|
||||
ColumnFamilyHandle* column_family) override {
|
||||
ColumnFamilyHandle* /*column_family*/) override {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -2445,7 +2451,8 @@ class ModelDB : public DB {
|
|||
virtual Env* GetEnv() const override { return nullptr; }
|
||||
|
||||
using DB::GetOptions;
|
||||
virtual Options GetOptions(ColumnFamilyHandle* column_family) const override {
|
||||
virtual Options GetOptions(
|
||||
ColumnFamilyHandle* /*column_family*/) const override {
|
||||
return options_;
|
||||
}
|
||||
|
||||
|
@ -2453,8 +2460,8 @@ class ModelDB : public DB {
|
|||
virtual DBOptions GetDBOptions() const override { return options_; }
|
||||
|
||||
using DB::Flush;
|
||||
virtual Status Flush(const rocksdb::FlushOptions& options,
|
||||
ColumnFamilyHandle* column_family) override {
|
||||
virtual Status Flush(const rocksdb::FlushOptions& /*options*/,
|
||||
ColumnFamilyHandle* /*column_family*/) override {
|
||||
Status ret;
|
||||
return ret;
|
||||
}
|
||||
|
@ -2464,39 +2471,42 @@ class ModelDB : public DB {
|
|||
#ifndef ROCKSDB_LITE
|
||||
virtual Status DisableFileDeletions() override { return Status::OK(); }
|
||||
|
||||
virtual Status EnableFileDeletions(bool force) override {
|
||||
virtual Status EnableFileDeletions(bool /*force*/) override {
|
||||
return Status::OK();
|
||||
}
|
||||
virtual Status GetLiveFiles(std::vector<std::string>&, uint64_t* size,
|
||||
bool flush_memtable = true) override {
|
||||
virtual Status GetLiveFiles(std::vector<std::string>&, uint64_t* /*size*/,
|
||||
bool /*flush_memtable*/ = true) override {
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
virtual Status GetSortedWalFiles(VectorLogPtr& files) override {
|
||||
virtual Status GetSortedWalFiles(VectorLogPtr& /*files*/) override {
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
virtual Status DeleteFile(std::string name) override { return Status::OK(); }
|
||||
virtual Status DeleteFile(std::string /*name*/) override {
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
virtual Status GetUpdatesSince(
|
||||
rocksdb::SequenceNumber, unique_ptr<rocksdb::TransactionLogIterator>*,
|
||||
const TransactionLogIterator::ReadOptions& read_options =
|
||||
const TransactionLogIterator::ReadOptions& /*read_options*/ =
|
||||
TransactionLogIterator::ReadOptions()) override {
|
||||
return Status::NotSupported("Not supported in Model DB");
|
||||
}
|
||||
|
||||
virtual void GetColumnFamilyMetaData(
|
||||
ColumnFamilyHandle* column_family,
|
||||
ColumnFamilyMetaData* metadata) override {}
|
||||
ColumnFamilyHandle* /*column_family*/,
|
||||
ColumnFamilyMetaData* /*metadata*/) override {}
|
||||
#endif // ROCKSDB_LITE
|
||||
|
||||
virtual Status GetDbIdentity(std::string& identity) const override {
|
||||
virtual Status GetDbIdentity(std::string& /*identity*/) const override {
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
virtual SequenceNumber GetLatestSequenceNumber() const override { return 0; }
|
||||
|
||||
virtual bool SetPreserveDeletesSequenceNumber(SequenceNumber seqnum) override {
|
||||
virtual bool SetPreserveDeletesSequenceNumber(
|
||||
SequenceNumber /*seqnum*/) override {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -4776,7 +4786,7 @@ class DelayedMergeOperator : public MergeOperator {
|
|||
public:
|
||||
explicit DelayedMergeOperator(DBTest* d) : db_test_(d) {}
|
||||
|
||||
virtual bool FullMergeV2(const MergeOperationInput& merge_in,
|
||||
virtual bool FullMergeV2(const MergeOperationInput& /*merge_in*/,
|
||||
MergeOperationOutput* merge_out) const override {
|
||||
db_test_->env_->addon_time_.fetch_add(1000);
|
||||
merge_out->new_value = "";
|
||||
|
|
|
@ -498,9 +498,9 @@ TEST_F(DBTest2, WalFilterTest) {
|
|||
apply_option_at_record_index_(apply_option_for_record_index),
|
||||
current_record_index_(0) {}
|
||||
|
||||
virtual WalProcessingOption LogRecord(const WriteBatch& batch,
|
||||
WriteBatch* new_batch,
|
||||
bool* batch_changed) const override {
|
||||
virtual WalProcessingOption LogRecord(
|
||||
const WriteBatch& /*batch*/, WriteBatch* /*new_batch*/,
|
||||
bool* /*batch_changed*/) const override {
|
||||
WalFilter::WalProcessingOption option_to_return;
|
||||
|
||||
if (current_record_index_ == apply_option_at_record_index_) {
|
||||
|
@ -874,11 +874,10 @@ TEST_F(DBTest2, WalFilterTestWithColumnFamilies) {
|
|||
cf_name_id_map_ = cf_name_id_map;
|
||||
}
|
||||
|
||||
virtual WalProcessingOption LogRecordFound(unsigned long long log_number,
|
||||
const std::string& log_file_name,
|
||||
const WriteBatch& batch,
|
||||
WriteBatch* new_batch,
|
||||
bool* batch_changed) override {
|
||||
virtual WalProcessingOption LogRecordFound(
|
||||
unsigned long long log_number, const std::string& /*log_file_name*/,
|
||||
const WriteBatch& batch, WriteBatch* /*new_batch*/,
|
||||
bool* /*batch_changed*/) override {
|
||||
class LogRecordBatchHandler : public WriteBatch::Handler {
|
||||
private:
|
||||
const std::map<uint32_t, uint64_t> & cf_log_number_map_;
|
||||
|
@ -1231,7 +1230,7 @@ class CompactionStallTestListener : public EventListener {
|
|||
public:
|
||||
CompactionStallTestListener() : compacted_files_cnt_(0) {}
|
||||
|
||||
void OnCompactionCompleted(DB* db, const CompactionJobInfo& ci) override {
|
||||
void OnCompactionCompleted(DB* /*db*/, const CompactionJobInfo& ci) override {
|
||||
ASSERT_EQ(ci.cf_name, "default");
|
||||
ASSERT_EQ(ci.base_input_level, 0);
|
||||
ASSERT_EQ(ci.compaction_reason, CompactionReason::kLevelL0FilesNum);
|
||||
|
|
|
@ -1143,17 +1143,18 @@ UpdateStatus DBTestBase::updateInPlaceSmallerVarintSize(char* prevValue,
|
|||
}
|
||||
}
|
||||
|
||||
UpdateStatus DBTestBase::updateInPlaceLargerSize(char* prevValue,
|
||||
uint32_t* prevSize,
|
||||
UpdateStatus DBTestBase::updateInPlaceLargerSize(char* /*prevValue*/,
|
||||
uint32_t* /*prevSize*/,
|
||||
Slice delta,
|
||||
std::string* newValue) {
|
||||
*newValue = std::string(delta.size(), 'c');
|
||||
return UpdateStatus::UPDATED;
|
||||
}
|
||||
|
||||
UpdateStatus DBTestBase::updateInPlaceNoAction(char* prevValue,
|
||||
uint32_t* prevSize, Slice delta,
|
||||
std::string* newValue) {
|
||||
UpdateStatus DBTestBase::updateInPlaceNoAction(char* /*prevValue*/,
|
||||
uint32_t* /*prevSize*/,
|
||||
Slice /*delta*/,
|
||||
std::string* /*newValue*/) {
|
||||
return UpdateStatus::UPDATE_FAILED;
|
||||
}
|
||||
|
||||
|
|
|
@ -187,7 +187,7 @@ class SpecialSkipListFactory : public MemTableRepFactory {
|
|||
using MemTableRepFactory::CreateMemTableRep;
|
||||
virtual MemTableRep* CreateMemTableRep(
|
||||
const MemTableRep::KeyComparator& compare, Allocator* allocator,
|
||||
const SliceTransform* transform, Logger* logger) override {
|
||||
const SliceTransform* transform, Logger* /*logger*/) override {
|
||||
return new SpecialMemTableRep(
|
||||
allocator, factory_.CreateMemTableRep(compare, allocator, transform, 0),
|
||||
num_entries_flush_);
|
||||
|
|
|
@ -56,9 +56,9 @@ void VerifyCompactionResult(
|
|||
|
||||
class KeepFilter : public CompactionFilter {
|
||||
public:
|
||||
virtual bool Filter(int level, const Slice& key, const Slice& value,
|
||||
std::string* new_value, bool* value_changed) const
|
||||
override {
|
||||
virtual bool Filter(int /*level*/, const Slice& /*key*/,
|
||||
const Slice& /*value*/, std::string* /*new_value*/,
|
||||
bool* /*value_changed*/) const override {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -88,9 +88,9 @@ class KeepFilterFactory : public CompactionFilterFactory {
|
|||
class DelayFilter : public CompactionFilter {
|
||||
public:
|
||||
explicit DelayFilter(DBTestBase* d) : db_test(d) {}
|
||||
virtual bool Filter(int level, const Slice& key, const Slice& value,
|
||||
std::string* new_value,
|
||||
bool* value_changed) const override {
|
||||
virtual bool Filter(int /*level*/, const Slice& /*key*/,
|
||||
const Slice& /*value*/, std::string* /*new_value*/,
|
||||
bool* /*value_changed*/) const override {
|
||||
db_test->env_->addon_time_.fetch_add(1000);
|
||||
return true;
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ class DelayFilterFactory : public CompactionFilterFactory {
|
|||
public:
|
||||
explicit DelayFilterFactory(DBTestBase* d) : db_test(d) {}
|
||||
virtual std::unique_ptr<CompactionFilter> CreateCompactionFilter(
|
||||
const CompactionFilter::Context& context) override {
|
||||
const CompactionFilter::Context& /*context*/) override {
|
||||
return std::unique_ptr<CompactionFilter>(new DelayFilter(db_test));
|
||||
}
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@ class DeleteFileTest : public testing::Test {
|
|||
}
|
||||
|
||||
// An empty job to guard all jobs are processed
|
||||
static void GuardFinish(void* arg) {
|
||||
static void GuardFinish(void* /*arg*/) {
|
||||
TEST_SYNC_POINT("DeleteFileTest::GuardFinish");
|
||||
}
|
||||
};
|
||||
|
|
|
@ -396,8 +396,9 @@ class SstFileWriterCollector : public TablePropertiesCollector {
|
|||
return Status::OK();
|
||||
}
|
||||
|
||||
Status AddUserKey(const Slice& user_key, const Slice& value, EntryType type,
|
||||
SequenceNumber seq, uint64_t file_size) override {
|
||||
Status AddUserKey(const Slice& /*user_key*/, const Slice& /*value*/,
|
||||
EntryType /*type*/, SequenceNumber /*seq*/,
|
||||
uint64_t /*file_size*/) override {
|
||||
++count_;
|
||||
return Status::OK();
|
||||
}
|
||||
|
@ -417,7 +418,7 @@ class SstFileWriterCollectorFactory : public TablePropertiesCollectorFactory {
|
|||
explicit SstFileWriterCollectorFactory(std::string prefix)
|
||||
: prefix_(prefix), num_created_(0) {}
|
||||
virtual TablePropertiesCollector* CreateTablePropertiesCollector(
|
||||
TablePropertiesCollectorFactory::Context context) override {
|
||||
TablePropertiesCollectorFactory::Context /*context*/) override {
|
||||
num_created_++;
|
||||
return new SstFileWriterCollector(prefix_);
|
||||
}
|
||||
|
@ -1798,7 +1799,7 @@ TEST_F(ExternalSSTFileTest, FileWithCFInfo) {
|
|||
|
||||
class TestIngestExternalFileListener : public EventListener {
|
||||
public:
|
||||
void OnExternalFileIngested(DB* db,
|
||||
void OnExternalFileIngested(DB* /*db*/,
|
||||
const ExternalFileIngestionInfo& info) override {
|
||||
ingested_files.push_back(info);
|
||||
}
|
||||
|
|
|
@ -36,10 +36,10 @@ class IntComparator : public Comparator {
|
|||
|
||||
const char* Name() const override { return "IntComparator"; }
|
||||
|
||||
void FindShortestSeparator(std::string* start,
|
||||
const Slice& limit) const override {}
|
||||
void FindShortestSeparator(std::string* /*start*/,
|
||||
const Slice& /*limit*/) const override {}
|
||||
|
||||
void FindShortSuccessor(std::string* key) const override {}
|
||||
void FindShortSuccessor(std::string* /*key*/) const override {}
|
||||
};
|
||||
|
||||
class FileIndexerTest : public testing::Test {
|
||||
|
|
|
@ -104,7 +104,7 @@ class ForwardLevelIterator : public InternalIterator {
|
|||
file_iter_->Seek(internal_key);
|
||||
valid_ = file_iter_->Valid();
|
||||
}
|
||||
void SeekForPrev(const Slice& internal_key) override {
|
||||
void SeekForPrev(const Slice& /*internal_key*/) override {
|
||||
status_ = Status::NotSupported("ForwardLevelIterator::SeekForPrev()");
|
||||
valid_ = false;
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ class ForwardIterator : public InternalIterator {
|
|||
ColumnFamilyData* cfd, SuperVersion* current_sv = nullptr);
|
||||
virtual ~ForwardIterator();
|
||||
|
||||
void SeekForPrev(const Slice& target) override {
|
||||
void SeekForPrev(const Slice& /*target*/) override {
|
||||
status_ = Status::NotSupported("ForwardIterator::SeekForPrev()");
|
||||
valid_ = false;
|
||||
}
|
||||
|
|
|
@ -442,7 +442,7 @@ bool InternalStats::GetStringProperty(const DBPropertyInfo& property_info,
|
|||
}
|
||||
|
||||
bool InternalStats::GetMapProperty(const DBPropertyInfo& property_info,
|
||||
const Slice& property,
|
||||
const Slice& /*property*/,
|
||||
std::map<std::string, std::string>* value) {
|
||||
assert(value != nullptr);
|
||||
assert(property_info.handle_map != nullptr);
|
||||
|
@ -494,7 +494,7 @@ bool InternalStats::HandleCompressionRatioAtLevelPrefix(std::string* value,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleLevelStats(std::string* value, Slice suffix) {
|
||||
bool InternalStats::HandleLevelStats(std::string* value, Slice /*suffix*/) {
|
||||
char buf[1000];
|
||||
const auto* vstorage = cfd_->current()->storage_info();
|
||||
snprintf(buf, sizeof(buf),
|
||||
|
@ -527,35 +527,36 @@ bool InternalStats::HandleCFMapStats(
|
|||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleCFStats(std::string* value, Slice suffix) {
|
||||
bool InternalStats::HandleCFStats(std::string* value, Slice /*suffix*/) {
|
||||
DumpCFStats(value);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleCFStatsNoFileHistogram(std::string* value,
|
||||
Slice suffix) {
|
||||
Slice /*suffix*/) {
|
||||
DumpCFStatsNoFileHistogram(value);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleCFFileHistogram(std::string* value, Slice suffix) {
|
||||
bool InternalStats::HandleCFFileHistogram(std::string* value,
|
||||
Slice /*suffix*/) {
|
||||
DumpCFFileHistogram(value);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleDBStats(std::string* value, Slice suffix) {
|
||||
bool InternalStats::HandleDBStats(std::string* value, Slice /*suffix*/) {
|
||||
DumpDBStats(value);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleSsTables(std::string* value, Slice suffix) {
|
||||
bool InternalStats::HandleSsTables(std::string* value, Slice /*suffix*/) {
|
||||
auto* current = cfd_->current();
|
||||
*value = current->DebugString(true, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleAggregatedTableProperties(std::string* value,
|
||||
Slice suffix) {
|
||||
Slice /*suffix*/) {
|
||||
std::shared_ptr<const TableProperties> tp;
|
||||
auto s = cfd_->current()->GetAggregatedTableProperties(&tp);
|
||||
if (!s.ok()) {
|
||||
|
@ -582,34 +583,34 @@ bool InternalStats::HandleAggregatedTablePropertiesAtLevel(std::string* value,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleNumImmutableMemTable(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
bool InternalStats::HandleNumImmutableMemTable(uint64_t* value, DBImpl* /*db*/,
|
||||
Version* /*version*/) {
|
||||
*value = cfd_->imm()->NumNotFlushed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleNumImmutableMemTableFlushed(uint64_t* value,
|
||||
DBImpl* db,
|
||||
Version* version) {
|
||||
DBImpl* /*db*/,
|
||||
Version* /*version*/) {
|
||||
*value = cfd_->imm()->NumFlushed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleMemTableFlushPending(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
bool InternalStats::HandleMemTableFlushPending(uint64_t* value, DBImpl* /*db*/,
|
||||
Version* /*version*/) {
|
||||
// Return number of mem tables that are ready to flush (made immutable)
|
||||
*value = (cfd_->imm()->IsFlushPending() ? 1 : 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleNumRunningFlushes(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
Version* /*version*/) {
|
||||
*value = db->num_running_flushes();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleCompactionPending(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
bool InternalStats::HandleCompactionPending(uint64_t* value, DBImpl* /*db*/,
|
||||
Version* /*version*/) {
|
||||
// 1 if the system already determines at least one compaction is needed.
|
||||
// 0 otherwise,
|
||||
const auto* vstorage = cfd_->current()->storage_info();
|
||||
|
@ -618,70 +619,74 @@ bool InternalStats::HandleCompactionPending(uint64_t* value, DBImpl* db,
|
|||
}
|
||||
|
||||
bool InternalStats::HandleNumRunningCompactions(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
Version* /*version*/) {
|
||||
*value = db->num_running_compactions_;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleBackgroundErrors(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
bool InternalStats::HandleBackgroundErrors(uint64_t* value, DBImpl* /*db*/,
|
||||
Version* /*version*/) {
|
||||
// Accumulated number of errors in background flushes or compactions.
|
||||
*value = GetBackgroundErrorCount();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleCurSizeActiveMemTable(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
bool InternalStats::HandleCurSizeActiveMemTable(uint64_t* value, DBImpl* /*db*/,
|
||||
Version* /*version*/) {
|
||||
// Current size of the active memtable
|
||||
*value = cfd_->mem()->ApproximateMemoryUsage();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleCurSizeAllMemTables(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
bool InternalStats::HandleCurSizeAllMemTables(uint64_t* value, DBImpl* /*db*/,
|
||||
Version* /*version*/) {
|
||||
// Current size of the active memtable + immutable memtables
|
||||
*value = cfd_->mem()->ApproximateMemoryUsage() +
|
||||
cfd_->imm()->ApproximateUnflushedMemTablesMemoryUsage();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleSizeAllMemTables(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
bool InternalStats::HandleSizeAllMemTables(uint64_t* value, DBImpl* /*db*/,
|
||||
Version* /*version*/) {
|
||||
*value = cfd_->mem()->ApproximateMemoryUsage() +
|
||||
cfd_->imm()->ApproximateMemoryUsage();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleNumEntriesActiveMemTable(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
bool InternalStats::HandleNumEntriesActiveMemTable(uint64_t* value,
|
||||
DBImpl* /*db*/,
|
||||
Version* /*version*/) {
|
||||
// Current number of entires in the active memtable
|
||||
*value = cfd_->mem()->num_entries();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleNumEntriesImmMemTables(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
bool InternalStats::HandleNumEntriesImmMemTables(uint64_t* value,
|
||||
DBImpl* /*db*/,
|
||||
Version* /*version*/) {
|
||||
// Current number of entries in the immutable memtables
|
||||
*value = cfd_->imm()->current()->GetTotalNumEntries();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleNumDeletesActiveMemTable(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
bool InternalStats::HandleNumDeletesActiveMemTable(uint64_t* value,
|
||||
DBImpl* /*db*/,
|
||||
Version* /*version*/) {
|
||||
// Current number of entires in the active memtable
|
||||
*value = cfd_->mem()->num_deletes();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleNumDeletesImmMemTables(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
bool InternalStats::HandleNumDeletesImmMemTables(uint64_t* value,
|
||||
DBImpl* /*db*/,
|
||||
Version* /*version*/) {
|
||||
// Current number of entries in the immutable memtables
|
||||
*value = cfd_->imm()->current()->GetTotalNumDeletes();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleEstimateNumKeys(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
bool InternalStats::HandleEstimateNumKeys(uint64_t* value, DBImpl* /*db*/,
|
||||
Version* /*version*/) {
|
||||
// Estimate number of entries in the column family:
|
||||
// Use estimated entries in tables + total entries in memtables.
|
||||
const auto* vstorage = cfd_->current()->storage_info();
|
||||
|
@ -697,77 +702,79 @@ bool InternalStats::HandleEstimateNumKeys(uint64_t* value, DBImpl* db,
|
|||
}
|
||||
|
||||
bool InternalStats::HandleNumSnapshots(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
Version* /*version*/) {
|
||||
*value = db->snapshots().count();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleOldestSnapshotTime(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
Version* /*version*/) {
|
||||
*value = static_cast<uint64_t>(db->snapshots().GetOldestSnapshotTime());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleNumLiveVersions(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
bool InternalStats::HandleNumLiveVersions(uint64_t* value, DBImpl* /*db*/,
|
||||
Version* /*version*/) {
|
||||
*value = cfd_->GetNumLiveVersions();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleCurrentSuperVersionNumber(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
bool InternalStats::HandleCurrentSuperVersionNumber(uint64_t* value,
|
||||
DBImpl* /*db*/,
|
||||
Version* /*version*/) {
|
||||
*value = cfd_->GetSuperVersionNumber();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleIsFileDeletionsEnabled(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
Version* /*version*/) {
|
||||
*value = db->IsFileDeletionsEnabled();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleBaseLevel(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
bool InternalStats::HandleBaseLevel(uint64_t* value, DBImpl* /*db*/,
|
||||
Version* /*version*/) {
|
||||
const auto* vstorage = cfd_->current()->storage_info();
|
||||
*value = vstorage->base_level();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleTotalSstFilesSize(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
bool InternalStats::HandleTotalSstFilesSize(uint64_t* value, DBImpl* /*db*/,
|
||||
Version* /*version*/) {
|
||||
*value = cfd_->GetTotalSstFilesSize();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleEstimatePendingCompactionBytes(uint64_t* value,
|
||||
DBImpl* db,
|
||||
Version* version) {
|
||||
DBImpl* /*db*/,
|
||||
Version* /*version*/) {
|
||||
const auto* vstorage = cfd_->current()->storage_info();
|
||||
*value = vstorage->estimated_compaction_needed_bytes();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleEstimateTableReadersMem(uint64_t* value, DBImpl* db,
|
||||
bool InternalStats::HandleEstimateTableReadersMem(uint64_t* value,
|
||||
DBImpl* /*db*/,
|
||||
Version* version) {
|
||||
*value = (version == nullptr) ? 0 : version->GetMemoryUsageByTableReaders();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleEstimateLiveDataSize(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
bool InternalStats::HandleEstimateLiveDataSize(uint64_t* value, DBImpl* /*db*/,
|
||||
Version* /*version*/) {
|
||||
const auto* vstorage = cfd_->current()->storage_info();
|
||||
*value = vstorage->EstimateLiveDataSize();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleMinLogNumberToKeep(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
Version* /*version*/) {
|
||||
*value = db->MinLogNumberToKeep();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InternalStats::HandleActualDelayedWriteRate(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
Version* /*version*/) {
|
||||
const WriteController& wc = db->write_controller();
|
||||
if (!wc.NeedsDelay()) {
|
||||
*value = 0;
|
||||
|
@ -778,7 +785,7 @@ bool InternalStats::HandleActualDelayedWriteRate(uint64_t* value, DBImpl* db,
|
|||
}
|
||||
|
||||
bool InternalStats::HandleIsWriteStopped(uint64_t* value, DBImpl* db,
|
||||
Version* version) {
|
||||
Version* /*version*/) {
|
||||
*value = db->write_controller().IsStopped() ? 1 : 0;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -46,11 +46,11 @@ class EventListenerTest : public DBTestBase {
|
|||
};
|
||||
|
||||
struct TestPropertiesCollector : public rocksdb::TablePropertiesCollector {
|
||||
virtual rocksdb::Status AddUserKey(const rocksdb::Slice& key,
|
||||
const rocksdb::Slice& value,
|
||||
rocksdb::EntryType type,
|
||||
rocksdb::SequenceNumber seq,
|
||||
uint64_t file_size) override {
|
||||
virtual rocksdb::Status AddUserKey(const rocksdb::Slice& /*key*/,
|
||||
const rocksdb::Slice& /*value*/,
|
||||
rocksdb::EntryType /*type*/,
|
||||
rocksdb::SequenceNumber /*seq*/,
|
||||
uint64_t /*file_size*/) override {
|
||||
return Status::OK();
|
||||
}
|
||||
virtual rocksdb::Status Finish(
|
||||
|
@ -73,7 +73,7 @@ struct TestPropertiesCollector : public rocksdb::TablePropertiesCollector {
|
|||
class TestPropertiesCollectorFactory : public TablePropertiesCollectorFactory {
|
||||
public:
|
||||
virtual TablePropertiesCollector* CreateTablePropertiesCollector(
|
||||
TablePropertiesCollectorFactory::Context context) override {
|
||||
TablePropertiesCollectorFactory::Context /*context*/) override {
|
||||
return new TestPropertiesCollector;
|
||||
}
|
||||
const char* Name() const override { return "TestTablePropertiesCollector"; }
|
||||
|
@ -425,7 +425,7 @@ TEST_F(EventListenerTest, DisableBGCompaction) {
|
|||
|
||||
class TestCompactionReasonListener : public EventListener {
|
||||
public:
|
||||
void OnCompactionCompleted(DB* db, const CompactionJobInfo& ci) override {
|
||||
void OnCompactionCompleted(DB* /*db*/, const CompactionJobInfo& ci) override {
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
compaction_reasons_.push_back(ci.compaction_reason);
|
||||
}
|
||||
|
@ -807,7 +807,8 @@ class BackgroundErrorListener : public EventListener {
|
|||
public:
|
||||
BackgroundErrorListener(SpecialEnv* env) : env_(env), counter_(0) {}
|
||||
|
||||
void OnBackgroundError(BackgroundErrorReason reason, Status* bg_error) override {
|
||||
void OnBackgroundError(BackgroundErrorReason /*reason*/,
|
||||
Status* bg_error) override {
|
||||
if (counter_ == 0) {
|
||||
// suppress the first error and disable write-dropping such that a retry
|
||||
// can succeed.
|
||||
|
|
|
@ -41,7 +41,7 @@ static void GetJemallocStatus(void* mstat_arg, const char* status) {
|
|||
}
|
||||
#endif // ROCKSDB_JEMALLOC
|
||||
|
||||
void DumpMallocStats(std::string* stats) {
|
||||
void DumpMallocStats(std::string* /*stats*/) {
|
||||
#ifdef ROCKSDB_JEMALLOC
|
||||
MallocStatus mstat;
|
||||
const unsigned int kMallocStatusLen = 1000000;
|
||||
|
|
|
@ -46,9 +46,9 @@ class DestroyAllCompactionFilter : public CompactionFilter {
|
|||
public:
|
||||
DestroyAllCompactionFilter() {}
|
||||
|
||||
virtual bool Filter(int level, const Slice& key, const Slice& existing_value,
|
||||
std::string* new_value,
|
||||
bool* value_changed) const override {
|
||||
virtual bool Filter(int /*level*/, const Slice& /*key*/,
|
||||
const Slice& existing_value, std::string* /*new_value*/,
|
||||
bool* /*value_changed*/) const override {
|
||||
return existing_value.ToString() == "destroy";
|
||||
}
|
||||
|
||||
|
|
|
@ -236,7 +236,7 @@ int MemTable::KeyComparator::operator()(const char* prefix_len_key,
|
|||
return comparator.CompareKeySeq(a, key);
|
||||
}
|
||||
|
||||
void MemTableRep::InsertConcurrently(KeyHandle handle) {
|
||||
void MemTableRep::InsertConcurrently(KeyHandle /*handle*/) {
|
||||
#ifndef ROCKSDB_LITE
|
||||
throw std::runtime_error("concurrent insert not supported");
|
||||
#else
|
||||
|
|
|
@ -154,7 +154,7 @@ bool MemTableListVersion::GetFromList(
|
|||
}
|
||||
|
||||
Status MemTableListVersion::AddRangeTombstoneIterators(
|
||||
const ReadOptions& read_opts, Arena* arena,
|
||||
const ReadOptions& read_opts, Arena* /*arena*/,
|
||||
RangeDelAggregator* range_del_agg) {
|
||||
assert(range_del_agg != nullptr);
|
||||
for (auto& m : memlist_) {
|
||||
|
@ -300,7 +300,7 @@ void MemTableList::PickMemtablesToFlush(autovector<MemTable*>* ret) {
|
|||
}
|
||||
|
||||
void MemTableList::RollbackMemtableFlush(const autovector<MemTable*>& mems,
|
||||
uint64_t file_number) {
|
||||
uint64_t /*file_number*/) {
|
||||
AutoThreadOperationStageUpdater stage_updater(
|
||||
ThreadStatus::STAGE_MEMTABLE_ROLLBACK);
|
||||
assert(!mems.empty());
|
||||
|
|
|
@ -504,7 +504,7 @@ void runTest(int argc, const std::string& dbname, const bool use_ttl = false) {
|
|||
}
|
||||
} // namespace
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int main(int argc, char* /*argv*/ []) {
|
||||
//TODO: Make this test like a general rocksdb unit-test
|
||||
rocksdb::port::InstallStackTraceHandler();
|
||||
runTest(argc, test::TmpDir() + "/merge_testdb");
|
||||
|
|
|
@ -327,7 +327,7 @@ class TestPlainTableFactory : public PlainTableFactory {
|
|||
const TableReaderOptions& table_reader_options,
|
||||
unique_ptr<RandomAccessFileReader>&& file, uint64_t file_size,
|
||||
unique_ptr<TableReader>* table,
|
||||
bool prefetch_index_and_filter_in_cache) const override {
|
||||
bool /*prefetch_index_and_filter_in_cache*/) const override {
|
||||
TableProperties* props = nullptr;
|
||||
auto s =
|
||||
ReadTableProperties(file.get(), file_size, kPlainTableMagicNumber,
|
||||
|
|
|
@ -126,10 +126,10 @@ class TestKeyComparator : public Comparator {
|
|||
return "TestKeyComparator";
|
||||
}
|
||||
|
||||
virtual void FindShortestSeparator(std::string* start,
|
||||
const Slice& limit) const override {}
|
||||
virtual void FindShortestSeparator(std::string* /*start*/,
|
||||
const Slice& /*limit*/) const override {}
|
||||
|
||||
virtual void FindShortSuccessor(std::string* key) const override {}
|
||||
virtual void FindShortSuccessor(std::string* /*key*/) const override {}
|
||||
};
|
||||
|
||||
namespace {
|
||||
|
|
|
@ -19,8 +19,8 @@ class SnapshotChecker {
|
|||
class DisableGCSnapshotChecker : public SnapshotChecker {
|
||||
public:
|
||||
virtual ~DisableGCSnapshotChecker() {}
|
||||
virtual bool IsInSnapshot(SequenceNumber sequence,
|
||||
SequenceNumber snapshot_sequence) const {
|
||||
virtual bool IsInSnapshot(SequenceNumber /*sequence*/,
|
||||
SequenceNumber /*snapshot_sequence*/) const {
|
||||
// By returning false, we prevent all the values from being GCed
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace rocksdb {
|
|||
namespace {
|
||||
|
||||
template <class T>
|
||||
static void DeleteEntry(const Slice& key, void* value) {
|
||||
static void DeleteEntry(const Slice& /*key*/, void* value) {
|
||||
T* typed_value = reinterpret_cast<T*>(value);
|
||||
delete typed_value;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ static void UnrefEntry(void* arg1, void* arg2) {
|
|||
cache->Release(h);
|
||||
}
|
||||
|
||||
static void DeleteTableReader(void* arg1, void* arg2) {
|
||||
static void DeleteTableReader(void* arg1, void* /*arg2*/) {
|
||||
TableReader* table_reader = reinterpret_cast<TableReader*>(arg1);
|
||||
delete table_reader;
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
namespace rocksdb {
|
||||
|
||||
Status InternalKeyPropertiesCollector::InternalAdd(const Slice& key,
|
||||
const Slice& value,
|
||||
uint64_t file_size) {
|
||||
const Slice& /*value*/,
|
||||
uint64_t /*file_size*/) {
|
||||
ParsedInternalKey ikey;
|
||||
if (!ParseInternalKey(key, &ikey)) {
|
||||
return Status::InvalidArgument("Invalid internal key");
|
||||
|
|
|
@ -73,7 +73,7 @@ class InternalKeyPropertiesCollectorFactory
|
|||
: public IntTblPropCollectorFactory {
|
||||
public:
|
||||
virtual IntTblPropCollector* CreateIntTblPropCollector(
|
||||
uint32_t column_family_id) override {
|
||||
uint32_t /*column_family_id*/) override {
|
||||
return new InternalKeyPropertiesCollector();
|
||||
}
|
||||
|
||||
|
|
|
@ -82,8 +82,9 @@ class RegularKeysStartWithA: public TablePropertiesCollector {
|
|||
return Status::OK();
|
||||
}
|
||||
|
||||
Status AddUserKey(const Slice& user_key, const Slice& value, EntryType type,
|
||||
SequenceNumber seq, uint64_t file_size) override {
|
||||
Status AddUserKey(const Slice& user_key, const Slice& /*value*/,
|
||||
EntryType type, SequenceNumber /*seq*/,
|
||||
uint64_t file_size) override {
|
||||
// simply asssume all user keys are not empty.
|
||||
if (user_key.data()[0] == 'A') {
|
||||
++count_;
|
||||
|
@ -133,7 +134,7 @@ class RegularKeysStartWithABackwardCompatible
|
|||
return Status::OK();
|
||||
}
|
||||
|
||||
Status Add(const Slice& user_key, const Slice& value) override {
|
||||
Status Add(const Slice& user_key, const Slice& /*value*/) override {
|
||||
// simply asssume all user keys are not empty.
|
||||
if (user_key.data()[0] == 'A') {
|
||||
++count_;
|
||||
|
@ -161,8 +162,8 @@ class RegularKeysStartWithAInternal : public IntTblPropCollector {
|
|||
return Status::OK();
|
||||
}
|
||||
|
||||
Status InternalAdd(const Slice& user_key, const Slice& value,
|
||||
uint64_t file_size) override {
|
||||
Status InternalAdd(const Slice& user_key, const Slice& /*value*/,
|
||||
uint64_t /*file_size*/) override {
|
||||
// simply asssume all user keys are not empty.
|
||||
if (user_key.data()[0] == 'A') {
|
||||
++count_;
|
||||
|
@ -193,7 +194,7 @@ class RegularKeysStartWithAFactory : public IntTblPropCollectorFactory,
|
|||
}
|
||||
}
|
||||
virtual IntTblPropCollector* CreateIntTblPropCollector(
|
||||
uint32_t column_family_id) override {
|
||||
uint32_t /*column_family_id*/) override {
|
||||
return new RegularKeysStartWithAInternal();
|
||||
}
|
||||
const char* Name() const override { return "RegularKeysStartWithA"; }
|
||||
|
@ -203,7 +204,7 @@ class RegularKeysStartWithAFactory : public IntTblPropCollectorFactory,
|
|||
|
||||
class FlushBlockEveryThreePolicy : public FlushBlockPolicy {
|
||||
public:
|
||||
virtual bool Update(const Slice& key, const Slice& value) override {
|
||||
virtual bool Update(const Slice& /*key*/, const Slice& /*value*/) override {
|
||||
return (++count_ % 3U == 0);
|
||||
}
|
||||
|
||||
|
@ -220,8 +221,8 @@ class FlushBlockEveryThreePolicyFactory : public FlushBlockPolicyFactory {
|
|||
}
|
||||
|
||||
FlushBlockPolicy* NewFlushBlockPolicy(
|
||||
const BlockBasedTableOptions& table_options,
|
||||
const BlockBuilder& data_block_builder) const override {
|
||||
const BlockBasedTableOptions& /*table_options*/,
|
||||
const BlockBuilder& /*data_block_builder*/) const override {
|
||||
return new FlushBlockEveryThreePolicy;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -269,16 +269,18 @@ void TransactionLogIteratorImpl::UpdateCurrentWriteBatch(const Slice& record) {
|
|||
return Status::OK();
|
||||
}
|
||||
|
||||
Status PutCF(uint32_t cf, const Slice& key, const Slice& val) override {
|
||||
Status PutCF(uint32_t /*cf*/, const Slice& /*key*/,
|
||||
const Slice& /*val*/) override {
|
||||
return Status::OK();
|
||||
}
|
||||
Status DeleteCF(uint32_t cf, const Slice& key) override {
|
||||
Status DeleteCF(uint32_t /*cf*/, const Slice& /*key*/) override {
|
||||
return Status::OK();
|
||||
}
|
||||
Status SingleDeleteCF(uint32_t cf, const Slice& key) override {
|
||||
Status SingleDeleteCF(uint32_t /*cf*/, const Slice& /*key*/) override {
|
||||
return Status::OK();
|
||||
}
|
||||
Status MergeCF(uint32_t cf, const Slice& key, const Slice& val) override {
|
||||
Status MergeCF(uint32_t /*cf*/, const Slice& /*key*/,
|
||||
const Slice& /*val*/) override {
|
||||
return Status::OK();
|
||||
}
|
||||
Status MarkBeginPrepare() override { return Status::OK(); }
|
||||
|
|
|
@ -199,7 +199,7 @@ class VersionBuilder::Rep {
|
|||
}
|
||||
}
|
||||
|
||||
void CheckConsistencyForDeletes(VersionEdit* edit, uint64_t number,
|
||||
void CheckConsistencyForDeletes(VersionEdit* /*edit*/, uint64_t number,
|
||||
int level) {
|
||||
#ifdef NDEBUG
|
||||
if (!base_vstorage_->force_consistency_checks()) {
|
||||
|
|
|
@ -198,7 +198,7 @@ static bool GetInternalKey(Slice* input, InternalKey* dst) {
|
|||
}
|
||||
}
|
||||
|
||||
bool VersionEdit::GetLevel(Slice* input, int* level, const char** msg) {
|
||||
bool VersionEdit::GetLevel(Slice* input, int* level, const char** /*msg*/) {
|
||||
uint32_t v;
|
||||
if (GetVarint32(input, &v)) {
|
||||
*level = v;
|
||||
|
|
|
@ -2898,7 +2898,7 @@ void VersionSet::LogAndApplyCFHelper(VersionEdit* edit) {
|
|||
}
|
||||
|
||||
void VersionSet::LogAndApplyHelper(ColumnFamilyData* cfd,
|
||||
VersionBuilder* builder, Version* v,
|
||||
VersionBuilder* builder, Version* /*v*/,
|
||||
VersionEdit* edit, InstrumentedMutex* mu) {
|
||||
mu->AssertHeld();
|
||||
assert(!edit->IsColumnFamilyManipulation());
|
||||
|
|
|
@ -870,7 +870,7 @@ class VersionSet {
|
|||
|
||||
struct LogReporter : public log::Reader::Reporter {
|
||||
Status* status;
|
||||
virtual void Corruption(size_t bytes, const Status& s) override {
|
||||
virtual void Corruption(size_t /*bytes*/, const Status& s) override {
|
||||
if (this->status->ok()) *this->status = s;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -76,7 +76,9 @@ class CountingLogger : public Logger {
|
|||
public:
|
||||
CountingLogger() : log_count(0) {}
|
||||
using Logger::Logv;
|
||||
virtual void Logv(const char* format, va_list ap) override { log_count++; }
|
||||
virtual void Logv(const char* /*format*/, va_list /*ap*/) override {
|
||||
log_count++;
|
||||
}
|
||||
int log_count;
|
||||
};
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ class WalManagerTest : public testing::Test {
|
|||
}
|
||||
|
||||
// NOT thread safe
|
||||
void RollTheLog(bool archived) {
|
||||
void RollTheLog(bool /*archived*/) {
|
||||
current_log_number_++;
|
||||
std::string fname = ArchivedLogFileName(dbname_, current_log_number_);
|
||||
unique_ptr<WritableFile> file;
|
||||
|
|
|
@ -186,7 +186,7 @@ WriteBatch::~WriteBatch() { delete save_points_; }
|
|||
|
||||
WriteBatch::Handler::~Handler() { }
|
||||
|
||||
void WriteBatch::Handler::LogData(const Slice& blob) {
|
||||
void WriteBatch::Handler::LogData(const Slice& /*blob*/) {
|
||||
// If the user has not specified something to do with blobs, then we ignore
|
||||
// them.
|
||||
}
|
||||
|
@ -569,7 +569,7 @@ void WriteBatchInternal::SetSequence(WriteBatch* b, SequenceNumber seq) {
|
|||
EncodeFixed64(&b->rep_[0], seq);
|
||||
}
|
||||
|
||||
size_t WriteBatchInternal::GetFirstOffset(WriteBatch* b) {
|
||||
size_t WriteBatchInternal::GetFirstOffset(WriteBatch* /*b*/) {
|
||||
return WriteBatchInternal::kHeader;
|
||||
}
|
||||
|
||||
|
@ -1228,7 +1228,7 @@ class MemTableInserter : public WriteBatch::Handler {
|
|||
return PutCFImpl(column_family_id, key, value, kTypeValue);
|
||||
}
|
||||
|
||||
Status DeleteImpl(uint32_t column_family_id, const Slice& key,
|
||||
Status DeleteImpl(uint32_t /*column_family_id*/, const Slice& key,
|
||||
const Slice& value, ValueType delete_type) {
|
||||
Status ret_status;
|
||||
MemTable* mem = cf_mems_->GetMemTable();
|
||||
|
|
|
@ -437,7 +437,7 @@ TEST_F(WriteBatchTest, DISABLED_ManyUpdates) {
|
|||
struct NoopHandler : public WriteBatch::Handler {
|
||||
uint32_t num_seen = 0;
|
||||
char expected_char = 'A';
|
||||
virtual Status PutCF(uint32_t column_family_id, const Slice& key,
|
||||
virtual Status PutCF(uint32_t /*column_family_id*/, const Slice& key,
|
||||
const Slice& value) override {
|
||||
EXPECT_EQ(kKeyValueSize, key.size());
|
||||
EXPECT_EQ(kKeyValueSize, value.size());
|
||||
|
@ -452,22 +452,22 @@ TEST_F(WriteBatchTest, DISABLED_ManyUpdates) {
|
|||
++num_seen;
|
||||
return Status::OK();
|
||||
}
|
||||
virtual Status DeleteCF(uint32_t column_family_id,
|
||||
const Slice& key) override {
|
||||
virtual Status DeleteCF(uint32_t /*column_family_id*/,
|
||||
const Slice& /*key*/) override {
|
||||
ADD_FAILURE();
|
||||
return Status::OK();
|
||||
}
|
||||
virtual Status SingleDeleteCF(uint32_t column_family_id,
|
||||
const Slice& key) override {
|
||||
virtual Status SingleDeleteCF(uint32_t /*column_family_id*/,
|
||||
const Slice& /*key*/) override {
|
||||
ADD_FAILURE();
|
||||
return Status::OK();
|
||||
}
|
||||
virtual Status MergeCF(uint32_t column_family_id, const Slice& key,
|
||||
const Slice& value) override {
|
||||
virtual Status MergeCF(uint32_t /*column_family_id*/, const Slice& /*key*/,
|
||||
const Slice& /*value*/) override {
|
||||
ADD_FAILURE();
|
||||
return Status::OK();
|
||||
}
|
||||
virtual void LogData(const Slice& blob) override { ADD_FAILURE(); }
|
||||
virtual void LogData(const Slice& /*blob*/) override { ADD_FAILURE(); }
|
||||
virtual bool Continue() override { return num_seen < kNumUpdates; }
|
||||
} handler;
|
||||
|
||||
|
@ -492,7 +492,7 @@ TEST_F(WriteBatchTest, DISABLED_LargeKeyValue) {
|
|||
|
||||
struct NoopHandler : public WriteBatch::Handler {
|
||||
int num_seen = 0;
|
||||
virtual Status PutCF(uint32_t column_family_id, const Slice& key,
|
||||
virtual Status PutCF(uint32_t /*column_family_id*/, const Slice& key,
|
||||
const Slice& value) override {
|
||||
EXPECT_EQ(kKeyValueSize, key.size());
|
||||
EXPECT_EQ(kKeyValueSize, value.size());
|
||||
|
@ -503,22 +503,22 @@ TEST_F(WriteBatchTest, DISABLED_LargeKeyValue) {
|
|||
++num_seen;
|
||||
return Status::OK();
|
||||
}
|
||||
virtual Status DeleteCF(uint32_t column_family_id,
|
||||
const Slice& key) override {
|
||||
virtual Status DeleteCF(uint32_t /*column_family_id*/,
|
||||
const Slice& /*key*/) override {
|
||||
ADD_FAILURE();
|
||||
return Status::OK();
|
||||
}
|
||||
virtual Status SingleDeleteCF(uint32_t column_family_id,
|
||||
const Slice& key) override {
|
||||
virtual Status SingleDeleteCF(uint32_t /*column_family_id*/,
|
||||
const Slice& /*key*/) override {
|
||||
ADD_FAILURE();
|
||||
return Status::OK();
|
||||
}
|
||||
virtual Status MergeCF(uint32_t column_family_id, const Slice& key,
|
||||
const Slice& value) override {
|
||||
virtual Status MergeCF(uint32_t /*column_family_id*/, const Slice& /*key*/,
|
||||
const Slice& /*value*/) override {
|
||||
ADD_FAILURE();
|
||||
return Status::OK();
|
||||
}
|
||||
virtual void LogData(const Slice& blob) override { ADD_FAILURE(); }
|
||||
virtual void LogData(const Slice& /*blob*/) override { ADD_FAILURE(); }
|
||||
virtual bool Continue() override { return num_seen < 2; }
|
||||
} handler;
|
||||
|
||||
|
|
|
@ -54,9 +54,7 @@ class WriteCallbackTestWriteCallback1 : public WriteCallback {
|
|||
|
||||
class WriteCallbackTestWriteCallback2 : public WriteCallback {
|
||||
public:
|
||||
Status Callback(DB *db) override {
|
||||
return Status::Busy();
|
||||
}
|
||||
Status Callback(DB* /*db*/) override { return Status::Busy(); }
|
||||
bool AllowWriteBatching() override { return true; }
|
||||
};
|
||||
|
||||
|
@ -74,7 +72,7 @@ class MockWriteCallback : public WriteCallback {
|
|||
was_called_.store(other.was_called_.load());
|
||||
}
|
||||
|
||||
Status Callback(DB* db) override {
|
||||
Status Callback(DB* /*db*/) override {
|
||||
was_called_.store(true);
|
||||
if (should_fail_) {
|
||||
return Status::Busy();
|
||||
|
|
|
@ -456,7 +456,8 @@ void WriteThread::EnterAsMemTableWriter(Writer* leader,
|
|||
last_writer->sequence + WriteBatchInternal::Count(last_writer->batch) - 1;
|
||||
}
|
||||
|
||||
void WriteThread::ExitAsMemTableWriter(Writer* self, WriteGroup& write_group) {
|
||||
void WriteThread::ExitAsMemTableWriter(Writer* /*self*/,
|
||||
WriteGroup& write_group) {
|
||||
Writer* leader = write_group.leader;
|
||||
Writer* last_writer = write_group.last_writer;
|
||||
|
||||
|
|
|
@ -844,7 +844,9 @@ static void decodeCTRParameters(const char *prefix, size_t blockSize, uint64_t &
|
|||
|
||||
// CreateNewPrefix initialized an allocated block of prefix memory
|
||||
// for a new file.
|
||||
Status CTREncryptionProvider::CreateNewPrefix(const std::string& fname, char *prefix, size_t prefixLength) {
|
||||
Status CTREncryptionProvider::CreateNewPrefix(const std::string& /*fname*/,
|
||||
char* prefix,
|
||||
size_t prefixLength) {
|
||||
// Create & seed rnd.
|
||||
Random rnd((uint32_t)Env::Default()->NowMicros());
|
||||
// Fill entire prefix block with random values.
|
||||
|
@ -873,7 +875,9 @@ Status CTREncryptionProvider::CreateNewPrefix(const std::string& fname, char *pr
|
|||
// in plain text.
|
||||
// Returns the amount of space (starting from the start of the prefix)
|
||||
// that has been initialized.
|
||||
size_t CTREncryptionProvider::PopulateSecretPrefixPart(char *prefix, size_t prefixLength, size_t blockSize) {
|
||||
size_t CTREncryptionProvider::PopulateSecretPrefixPart(char* /*prefix*/,
|
||||
size_t /*prefixLength*/,
|
||||
size_t /*blockSize*/) {
|
||||
// Nothing to do here, put in custom data in override when needed.
|
||||
return 0;
|
||||
}
|
||||
|
@ -898,8 +902,10 @@ Status CTREncryptionProvider::CreateCipherStream(const std::string& fname, const
|
|||
|
||||
// CreateCipherStreamFromPrefix creates a block access cipher stream for a file given
|
||||
// given name and options. The given prefix is already decrypted.
|
||||
Status CTREncryptionProvider::CreateCipherStreamFromPrefix(const std::string& fname, const EnvOptions& options,
|
||||
uint64_t initialCounter, const Slice& iv, const Slice& prefix, unique_ptr<BlockAccessCipherStream>* result) {
|
||||
Status CTREncryptionProvider::CreateCipherStreamFromPrefix(
|
||||
const std::string& /*fname*/, const EnvOptions& /*options*/,
|
||||
uint64_t initialCounter, const Slice& iv, const Slice& /*prefix*/,
|
||||
unique_ptr<BlockAccessCipherStream>* result) {
|
||||
(*result) = unique_ptr<BlockAccessCipherStream>(new CTRCipherStream(cipher_, iv.data(), initialCounter));
|
||||
return Status::OK();
|
||||
}
|
||||
|
|
|
@ -602,13 +602,13 @@ Status NewHdfsEnv(Env** hdfs_env, const std::string& fsname) {
|
|||
|
||||
// dummy placeholders used when HDFS is not available
|
||||
namespace rocksdb {
|
||||
Status HdfsEnv::NewSequentialFile(const std::string& fname,
|
||||
unique_ptr<SequentialFile>* result,
|
||||
const EnvOptions& options) {
|
||||
return Status::NotSupported("Not compiled with hdfs support");
|
||||
Status HdfsEnv::NewSequentialFile(const std::string& /*fname*/,
|
||||
unique_ptr<SequentialFile>* /*result*/,
|
||||
const EnvOptions& /*options*/) {
|
||||
return Status::NotSupported("Not compiled with hdfs support");
|
||||
}
|
||||
|
||||
Status NewHdfsEnv(Env** hdfs_env, const std::string& fsname) {
|
||||
Status NewHdfsEnv(Env** /*hdfs_env*/, const std::string& /*fsname*/) {
|
||||
return Status::NotSupported("Not compiled with hdfs support");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1255,33 +1255,36 @@ TEST_P(EnvPosixTestWithParam, WritableFileWrapper) {
|
|||
inc(0);
|
||||
}
|
||||
|
||||
Status Append(const Slice& data) override { inc(1); return Status::OK(); }
|
||||
Status Truncate(uint64_t size) override { return Status::OK(); }
|
||||
Status Append(const Slice& /*data*/) override {
|
||||
inc(1);
|
||||
return Status::OK();
|
||||
}
|
||||
Status Truncate(uint64_t /*size*/) override { return Status::OK(); }
|
||||
Status Close() override { inc(2); return Status::OK(); }
|
||||
Status Flush() override { inc(3); return Status::OK(); }
|
||||
Status Sync() override { inc(4); return Status::OK(); }
|
||||
Status Fsync() override { inc(5); return Status::OK(); }
|
||||
void SetIOPriority(Env::IOPriority pri) override { inc(6); }
|
||||
void SetIOPriority(Env::IOPriority /*pri*/) override { inc(6); }
|
||||
uint64_t GetFileSize() override { inc(7); return 0; }
|
||||
void GetPreallocationStatus(size_t* block_size,
|
||||
size_t* last_allocated_block) override {
|
||||
void GetPreallocationStatus(size_t* /*block_size*/,
|
||||
size_t* /*last_allocated_block*/) override {
|
||||
inc(8);
|
||||
}
|
||||
size_t GetUniqueId(char* id, size_t max_size) const override {
|
||||
size_t GetUniqueId(char* /*id*/, size_t /*max_size*/) const override {
|
||||
inc(9);
|
||||
return 0;
|
||||
}
|
||||
Status InvalidateCache(size_t offset, size_t length) override {
|
||||
Status InvalidateCache(size_t /*offset*/, size_t /*length*/) override {
|
||||
inc(10);
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
protected:
|
||||
Status Allocate(uint64_t offset, uint64_t len) override {
|
||||
Status Allocate(uint64_t /*offset*/, uint64_t /*len*/) override {
|
||||
inc(11);
|
||||
return Status::OK();
|
||||
}
|
||||
Status RangeSync(uint64_t offset, uint64_t nbytes) override {
|
||||
Status RangeSync(uint64_t /*offset*/, uint64_t /*nbytes*/) override {
|
||||
inc(12);
|
||||
return Status::OK();
|
||||
}
|
||||
|
|
|
@ -448,7 +448,7 @@ PosixMmapReadableFile::~PosixMmapReadableFile() {
|
|||
}
|
||||
|
||||
Status PosixMmapReadableFile::Read(uint64_t offset, size_t n, Slice* result,
|
||||
char* scratch) const {
|
||||
char* /*scratch*/) const {
|
||||
Status s;
|
||||
if (offset > length_) {
|
||||
*result = Slice();
|
||||
|
@ -941,7 +941,7 @@ size_t PosixWritableFile::GetUniqueId(char* id, size_t max_size) const {
|
|||
*/
|
||||
|
||||
PosixRandomRWFile::PosixRandomRWFile(const std::string& fname, int fd,
|
||||
const EnvOptions& options)
|
||||
const EnvOptions& /*options*/)
|
||||
: filename_(fname), fd_(fd) {}
|
||||
|
||||
PosixRandomRWFile::~PosixRandomRWFile() {
|
||||
|
|
|
@ -202,7 +202,7 @@ class PosixMmapFile : public WritableFile {
|
|||
|
||||
// Means Close() will properly take care of truncate
|
||||
// and it does not need any additional information
|
||||
virtual Status Truncate(uint64_t size) override { return Status::OK(); }
|
||||
virtual Status Truncate(uint64_t /*size*/) override { return Status::OK(); }
|
||||
virtual Status Close() override;
|
||||
virtual Status Append(const Slice& data) override;
|
||||
virtual Status Flush() override;
|
||||
|
|
|
@ -447,8 +447,8 @@ MockEnv::~MockEnv() {
|
|||
|
||||
// Partial implementation of the Env interface.
|
||||
Status MockEnv::NewSequentialFile(const std::string& fname,
|
||||
unique_ptr<SequentialFile>* result,
|
||||
const EnvOptions& soptions) {
|
||||
unique_ptr<SequentialFile>* result,
|
||||
const EnvOptions& /*soptions*/) {
|
||||
auto fn = NormalizePath(fname);
|
||||
MutexLock lock(&mutex_);
|
||||
if (file_map_.find(fn) == file_map_.end()) {
|
||||
|
@ -464,8 +464,8 @@ Status MockEnv::NewSequentialFile(const std::string& fname,
|
|||
}
|
||||
|
||||
Status MockEnv::NewRandomAccessFile(const std::string& fname,
|
||||
unique_ptr<RandomAccessFile>* result,
|
||||
const EnvOptions& soptions) {
|
||||
unique_ptr<RandomAccessFile>* result,
|
||||
const EnvOptions& /*soptions*/) {
|
||||
auto fn = NormalizePath(fname);
|
||||
MutexLock lock(&mutex_);
|
||||
if (file_map_.find(fn) == file_map_.end()) {
|
||||
|
@ -482,7 +482,7 @@ Status MockEnv::NewRandomAccessFile(const std::string& fname,
|
|||
|
||||
Status MockEnv::NewRandomRWFile(const std::string& fname,
|
||||
unique_ptr<RandomRWFile>* result,
|
||||
const EnvOptions& soptions) {
|
||||
const EnvOptions& /*soptions*/) {
|
||||
auto fn = NormalizePath(fname);
|
||||
MutexLock lock(&mutex_);
|
||||
if (file_map_.find(fn) == file_map_.end()) {
|
||||
|
@ -525,8 +525,8 @@ Status MockEnv::NewWritableFile(const std::string& fname,
|
|||
return Status::OK();
|
||||
}
|
||||
|
||||
Status MockEnv::NewDirectory(const std::string& name,
|
||||
unique_ptr<Directory>* result) {
|
||||
Status MockEnv::NewDirectory(const std::string& /*name*/,
|
||||
unique_ptr<Directory>* result) {
|
||||
result->reset(new MockEnvDirectory());
|
||||
return Status::OK();
|
||||
}
|
||||
|
|
109
hdfs/env_hdfs.h
109
hdfs/env_hdfs.h
|
@ -245,7 +245,7 @@ static const Status notsup;
|
|||
class HdfsEnv : public Env {
|
||||
|
||||
public:
|
||||
explicit HdfsEnv(const std::string& fsname) {
|
||||
explicit HdfsEnv(const std::string& /*fsname*/) {
|
||||
fprintf(stderr, "You have not build rocksdb with HDFS support\n");
|
||||
fprintf(stderr, "Please see hdfs/README for details\n");
|
||||
abort();
|
||||
|
@ -258,112 +258,125 @@ class HdfsEnv : public Env {
|
|||
unique_ptr<SequentialFile>* result,
|
||||
const EnvOptions& options) override;
|
||||
|
||||
virtual Status NewRandomAccessFile(const std::string& fname,
|
||||
unique_ptr<RandomAccessFile>* result,
|
||||
const EnvOptions& options) override {
|
||||
virtual Status NewRandomAccessFile(const std::string& /*fname*/,
|
||||
unique_ptr<RandomAccessFile>* /*result*/,
|
||||
const EnvOptions& /*options*/) override {
|
||||
return notsup;
|
||||
}
|
||||
|
||||
virtual Status NewWritableFile(const std::string& fname,
|
||||
unique_ptr<WritableFile>* result,
|
||||
const EnvOptions& options) override {
|
||||
virtual Status NewWritableFile(const std::string& /*fname*/,
|
||||
unique_ptr<WritableFile>* /*result*/,
|
||||
const EnvOptions& /*options*/) override {
|
||||
return notsup;
|
||||
}
|
||||
|
||||
virtual Status NewDirectory(const std::string& name,
|
||||
unique_ptr<Directory>* result) override {
|
||||
virtual Status NewDirectory(const std::string& /*name*/,
|
||||
unique_ptr<Directory>* /*result*/) override {
|
||||
return notsup;
|
||||
}
|
||||
|
||||
virtual Status FileExists(const std::string& fname) override {
|
||||
virtual Status FileExists(const std::string& /*fname*/) override {
|
||||
return notsup;
|
||||
}
|
||||
|
||||
virtual Status GetChildren(const std::string& path,
|
||||
std::vector<std::string>* result) override {
|
||||
virtual Status GetChildren(const std::string& /*path*/,
|
||||
std::vector<std::string>* /*result*/) override {
|
||||
return notsup;
|
||||
}
|
||||
|
||||
virtual Status DeleteFile(const std::string& fname) override {
|
||||
virtual Status DeleteFile(const std::string& /*fname*/) override {
|
||||
return notsup;
|
||||
}
|
||||
|
||||
virtual Status CreateDir(const std::string& name) override { return notsup; }
|
||||
|
||||
virtual Status CreateDirIfMissing(const std::string& name) override {
|
||||
virtual Status CreateDir(const std::string& /*name*/) override {
|
||||
return notsup;
|
||||
}
|
||||
|
||||
virtual Status DeleteDir(const std::string& name) override { return notsup; }
|
||||
|
||||
virtual Status GetFileSize(const std::string& fname,
|
||||
uint64_t* size) override {
|
||||
virtual Status CreateDirIfMissing(const std::string& /*name*/) override {
|
||||
return notsup;
|
||||
}
|
||||
|
||||
virtual Status GetFileModificationTime(const std::string& fname,
|
||||
uint64_t* time) override {
|
||||
virtual Status DeleteDir(const std::string& /*name*/) override {
|
||||
return notsup;
|
||||
}
|
||||
|
||||
virtual Status RenameFile(const std::string& src,
|
||||
const std::string& target) override {
|
||||
virtual Status GetFileSize(const std::string& /*fname*/,
|
||||
uint64_t* /*size*/) override {
|
||||
return notsup;
|
||||
}
|
||||
|
||||
virtual Status LinkFile(const std::string& src,
|
||||
const std::string& target) override {
|
||||
virtual Status GetFileModificationTime(const std::string& /*fname*/,
|
||||
uint64_t* /*time*/) override {
|
||||
return notsup;
|
||||
}
|
||||
|
||||
virtual Status LockFile(const std::string& fname, FileLock** lock) override {
|
||||
virtual Status RenameFile(const std::string& /*src*/,
|
||||
const std::string& /*target*/) override {
|
||||
return notsup;
|
||||
}
|
||||
|
||||
virtual Status UnlockFile(FileLock* lock) override { return notsup; }
|
||||
|
||||
virtual Status NewLogger(const std::string& fname,
|
||||
shared_ptr<Logger>* result) override {
|
||||
virtual Status LinkFile(const std::string& /*src*/,
|
||||
const std::string& /*target*/) override {
|
||||
return notsup;
|
||||
}
|
||||
|
||||
virtual void Schedule(void (*function)(void* arg), void* arg,
|
||||
Priority pri = LOW, void* tag = nullptr,
|
||||
void (*unschedFunction)(void* arg) = 0) override {}
|
||||
virtual Status LockFile(const std::string& /*fname*/,
|
||||
FileLock** /*lock*/) override {
|
||||
return notsup;
|
||||
}
|
||||
|
||||
virtual int UnSchedule(void* tag, Priority pri) override { return 0; }
|
||||
virtual Status UnlockFile(FileLock* /*lock*/) override { return notsup; }
|
||||
|
||||
virtual void StartThread(void (*function)(void* arg), void* arg) override {}
|
||||
virtual Status NewLogger(const std::string& /*fname*/,
|
||||
shared_ptr<Logger>* /*result*/) override {
|
||||
return notsup;
|
||||
}
|
||||
|
||||
virtual void Schedule(void (*/*function*/)(void* arg), void* /*arg*/,
|
||||
Priority /*pri*/ = LOW, void* /*tag*/ = nullptr,
|
||||
void (*/*unschedFunction*/)(void* arg) = 0) override {}
|
||||
|
||||
virtual int UnSchedule(void* /*tag*/, Priority /*pri*/) override { return 0; }
|
||||
|
||||
virtual void StartThread(void (*/*function*/)(void* arg),
|
||||
void* /*arg*/) override {}
|
||||
|
||||
virtual void WaitForJoin() override {}
|
||||
|
||||
virtual unsigned int GetThreadPoolQueueLen(
|
||||
Priority pri = LOW) const override {
|
||||
Priority /*pri*/ = LOW) const override {
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual Status GetTestDirectory(std::string* path) override { return notsup; }
|
||||
virtual Status GetTestDirectory(std::string* /*path*/) override {
|
||||
return notsup;
|
||||
}
|
||||
|
||||
virtual uint64_t NowMicros() override { return 0; }
|
||||
|
||||
virtual void SleepForMicroseconds(int micros) override {}
|
||||
virtual void SleepForMicroseconds(int /*micros*/) override {}
|
||||
|
||||
virtual Status GetHostName(char* name, uint64_t len) override {
|
||||
virtual Status GetHostName(char* /*name*/, uint64_t /*len*/) override {
|
||||
return notsup;
|
||||
}
|
||||
|
||||
virtual Status GetCurrentTime(int64_t* unix_time) override { return notsup; }
|
||||
|
||||
virtual Status GetAbsolutePath(const std::string& db_path,
|
||||
std::string* outputpath) override {
|
||||
virtual Status GetCurrentTime(int64_t* /*unix_time*/) override {
|
||||
return notsup;
|
||||
}
|
||||
|
||||
virtual void SetBackgroundThreads(int number, Priority pri = LOW) override {}
|
||||
virtual int GetBackgroundThreads(Priority pri = LOW) override { return 0; }
|
||||
virtual void IncBackgroundThreadsIfNeeded(int number, Priority pri) override {
|
||||
virtual Status GetAbsolutePath(const std::string& /*db_path*/,
|
||||
std::string* /*outputpath*/) override {
|
||||
return notsup;
|
||||
}
|
||||
virtual std::string TimeToString(uint64_t number) override { return ""; }
|
||||
|
||||
virtual void SetBackgroundThreads(int /*number*/,
|
||||
Priority /*pri*/ = LOW) override {}
|
||||
virtual int GetBackgroundThreads(Priority /*pri*/ = LOW) override {
|
||||
return 0;
|
||||
}
|
||||
virtual void IncBackgroundThreadsIfNeeded(int /*number*/,
|
||||
Priority /*pri*/) override {}
|
||||
virtual std::string TimeToString(uint64_t /*number*/) override { return ""; }
|
||||
|
||||
virtual uint64_t GetThreadID() const override {
|
||||
return 0;
|
||||
|
|
|
@ -216,7 +216,8 @@ class Cache {
|
|||
|
||||
// Mark the last inserted object as being a raw data block. This will be used
|
||||
// in tests. The default implementation does nothing.
|
||||
virtual void TEST_mark_as_data_block(const Slice& key, size_t charge) {}
|
||||
virtual void TEST_mark_as_data_block(const Slice& /*key*/,
|
||||
size_t /*charge*/) {}
|
||||
|
||||
private:
|
||||
// No copying allowed
|
||||
|
|
|
@ -94,8 +94,10 @@ class CompactionFilter {
|
|||
// be used by a single thread that is doing the compaction run, and this
|
||||
// call does not need to be thread-safe. However, multiple filters may be
|
||||
// in existence and operating concurrently.
|
||||
virtual bool Filter(int level, const Slice& key, const Slice& existing_value,
|
||||
std::string* new_value, bool* value_changed) const {
|
||||
virtual bool Filter(int /*level*/, const Slice& /*key*/,
|
||||
const Slice& /*existing_value*/,
|
||||
std::string* /*new_value*/,
|
||||
bool* /*value_changed*/) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -108,8 +110,8 @@ class CompactionFilter {
|
|||
// may not realize there is a write conflict and may allow a Transaction to
|
||||
// Commit that should have failed. Instead, it is better to implement any
|
||||
// Merge filtering inside the MergeOperator.
|
||||
virtual bool FilterMergeOperand(int level, const Slice& key,
|
||||
const Slice& operand) const {
|
||||
virtual bool FilterMergeOperand(int /*level*/, const Slice& /*key*/,
|
||||
const Slice& /*operand*/) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -154,7 +156,7 @@ class CompactionFilter {
|
|||
// MergeOperator.
|
||||
virtual Decision FilterV2(int level, const Slice& key, ValueType value_type,
|
||||
const Slice& existing_value, std::string* new_value,
|
||||
std::string* skip_until) const {
|
||||
std::string* /*skip_until*/) const {
|
||||
switch (value_type) {
|
||||
case ValueType::kValue: {
|
||||
bool value_changed = false;
|
||||
|
|
|
@ -878,7 +878,7 @@ class DB {
|
|||
|
||||
// Flush the WAL memory buffer to the file. If sync is true, it calls SyncWAL
|
||||
// afterwards.
|
||||
virtual Status FlushWAL(bool sync) {
|
||||
virtual Status FlushWAL(bool /*sync*/) {
|
||||
return Status::NotSupported("FlushWAL not implemented");
|
||||
}
|
||||
// Sync the wal. Note that Write() followed by SyncWAL() is not exactly the
|
||||
|
@ -1132,13 +1132,14 @@ class DB {
|
|||
ColumnFamilyHandle* column_family, const Range* range, std::size_t n,
|
||||
TablePropertiesCollection* props) = 0;
|
||||
|
||||
virtual Status SuggestCompactRange(ColumnFamilyHandle* column_family,
|
||||
const Slice* begin, const Slice* end) {
|
||||
virtual Status SuggestCompactRange(ColumnFamilyHandle* /*column_family*/,
|
||||
const Slice* /*begin*/,
|
||||
const Slice* /*end*/) {
|
||||
return Status::NotSupported("SuggestCompactRange() is not implemented.");
|
||||
}
|
||||
|
||||
virtual Status PromoteL0(ColumnFamilyHandle* column_family,
|
||||
int target_level) {
|
||||
virtual Status PromoteL0(ColumnFamilyHandle* /*column_family*/,
|
||||
int /*target_level*/) {
|
||||
return Status::NotSupported("PromoteL0() is not implemented.");
|
||||
}
|
||||
|
||||
|
|
|
@ -181,9 +181,9 @@ class Env {
|
|||
// returns non-OK.
|
||||
//
|
||||
// The returned file will only be accessed by one thread at a time.
|
||||
virtual Status ReopenWritableFile(const std::string& fname,
|
||||
unique_ptr<WritableFile>* result,
|
||||
const EnvOptions& options) {
|
||||
virtual Status ReopenWritableFile(const std::string& /*fname*/,
|
||||
unique_ptr<WritableFile>* /*result*/,
|
||||
const EnvOptions& /*options*/) {
|
||||
return Status::NotSupported();
|
||||
}
|
||||
|
||||
|
@ -198,9 +198,9 @@ class Env {
|
|||
// *result and returns OK. On failure returns non-OK.
|
||||
//
|
||||
// The returned file will only be accessed by one thread at a time.
|
||||
virtual Status NewRandomRWFile(const std::string& fname,
|
||||
unique_ptr<RandomRWFile>* result,
|
||||
const EnvOptions& options) {
|
||||
virtual Status NewRandomRWFile(const std::string& /*fname*/,
|
||||
unique_ptr<RandomRWFile>* /*result*/,
|
||||
const EnvOptions& /*options*/) {
|
||||
return Status::NotSupported("RandomRWFile is not implemented in this Env");
|
||||
}
|
||||
|
||||
|
@ -268,12 +268,13 @@ class Env {
|
|||
const std::string& target) = 0;
|
||||
|
||||
// Hard Link file src to target.
|
||||
virtual Status LinkFile(const std::string& src, const std::string& target) {
|
||||
virtual Status LinkFile(const std::string& /*src*/,
|
||||
const std::string& /*target*/) {
|
||||
return Status::NotSupported("LinkFile is not supported for this Env");
|
||||
}
|
||||
|
||||
virtual Status AreFilesSame(const std::string& first,
|
||||
const std::string& second, bool* res) {
|
||||
virtual Status AreFilesSame(const std::string& /*first*/,
|
||||
const std::string& /*second*/, bool* /*res*/) {
|
||||
return Status::NotSupported("AreFilesSame is not supported for this Env");
|
||||
}
|
||||
|
||||
|
@ -324,7 +325,7 @@ class Env {
|
|||
|
||||
// Arrange to remove jobs for given arg from the queue_ if they are not
|
||||
// already scheduled. Caller is expected to have exclusive lock on arg.
|
||||
virtual int UnSchedule(void* arg, Priority pri) { return 0; }
|
||||
virtual int UnSchedule(void* /*arg*/, Priority /*pri*/) { return 0; }
|
||||
|
||||
// Start a new thread, invoking "function(arg)" within the new thread.
|
||||
// When "function(arg)" returns, the thread will be destroyed.
|
||||
|
@ -334,7 +335,7 @@ class Env {
|
|||
virtual void WaitForJoin() {}
|
||||
|
||||
// Get thread pool queue length for specific thread pool.
|
||||
virtual unsigned int GetThreadPoolQueueLen(Priority pri = LOW) const {
|
||||
virtual unsigned int GetThreadPoolQueueLen(Priority /*pri*/ = LOW) const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -388,7 +389,7 @@ class Env {
|
|||
virtual void IncBackgroundThreadsIfNeeded(int number, Priority pri) = 0;
|
||||
|
||||
// Lower IO priority for threads from the specified pool.
|
||||
virtual void LowerThreadPoolIOPriority(Priority pool = LOW) {}
|
||||
virtual void LowerThreadPoolIOPriority(Priority /*pool*/ = LOW) {}
|
||||
|
||||
// Converts seconds-since-Jan-01-1970 to a printable string
|
||||
virtual std::string TimeToString(uint64_t time) = 0;
|
||||
|
@ -432,7 +433,7 @@ class Env {
|
|||
const ImmutableDBOptions& db_options) const;
|
||||
|
||||
// Returns the status of all threads that belong to the current Env.
|
||||
virtual Status GetThreadList(std::vector<ThreadStatus>* thread_list) {
|
||||
virtual Status GetThreadList(std::vector<ThreadStatus>* /*thread_list*/) {
|
||||
return Status::NotSupported("Not supported.");
|
||||
}
|
||||
|
||||
|
@ -498,14 +499,14 @@ class SequentialFile {
|
|||
// Remove any kind of caching of data from the offset to offset+length
|
||||
// of this file. If the length is 0, then it refers to the end of file.
|
||||
// If the system is not caching the file contents, then this is a noop.
|
||||
virtual Status InvalidateCache(size_t offset, size_t length) {
|
||||
virtual Status InvalidateCache(size_t /*offset*/, size_t /*length*/) {
|
||||
return Status::NotSupported("InvalidateCache not supported.");
|
||||
}
|
||||
|
||||
// Positioned Read for direct I/O
|
||||
// If Direct I/O enabled, offset, n, and scratch should be properly aligned
|
||||
virtual Status PositionedRead(uint64_t offset, size_t n, Slice* result,
|
||||
char* scratch) {
|
||||
virtual Status PositionedRead(uint64_t /*offset*/, size_t /*n*/,
|
||||
Slice* /*result*/, char* /*scratch*/) {
|
||||
return Status::NotSupported();
|
||||
}
|
||||
};
|
||||
|
@ -531,7 +532,7 @@ class RandomAccessFile {
|
|||
char* scratch) const = 0;
|
||||
|
||||
// Readahead the file starting from offset by n bytes for caching.
|
||||
virtual Status Prefetch(uint64_t offset, size_t n) {
|
||||
virtual Status Prefetch(uint64_t /*offset*/, size_t /*n*/) {
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
|
@ -550,14 +551,14 @@ class RandomAccessFile {
|
|||
// a single varint.
|
||||
//
|
||||
// Note: these IDs are only valid for the duration of the process.
|
||||
virtual size_t GetUniqueId(char* id, size_t max_size) const {
|
||||
virtual size_t GetUniqueId(char* /*id*/, size_t /*max_size*/) const {
|
||||
return 0; // Default implementation to prevent issues with backwards
|
||||
// compatibility.
|
||||
};
|
||||
|
||||
enum AccessPattern { NORMAL, RANDOM, SEQUENTIAL, WILLNEED, DONTNEED };
|
||||
|
||||
virtual void Hint(AccessPattern pattern) {}
|
||||
virtual void Hint(AccessPattern /*pattern*/) {}
|
||||
|
||||
// Indicates the upper layers if the current RandomAccessFile implementation
|
||||
// uses direct IO.
|
||||
|
@ -570,7 +571,7 @@ class RandomAccessFile {
|
|||
// Remove any kind of caching of data from the offset to offset+length
|
||||
// of this file. If the length is 0, then it refers to the end of file.
|
||||
// If the system is not caching the file contents, then this is a noop.
|
||||
virtual Status InvalidateCache(size_t offset, size_t length) {
|
||||
virtual Status InvalidateCache(size_t /*offset*/, size_t /*length*/) {
|
||||
return Status::NotSupported("InvalidateCache not supported.");
|
||||
}
|
||||
};
|
||||
|
@ -621,9 +622,7 @@ class WritableFile {
|
|||
// before closing. It is not always possible to keep track of the file
|
||||
// size due to whole pages writes. The behavior is undefined if called
|
||||
// with other writes to follow.
|
||||
virtual Status Truncate(uint64_t size) {
|
||||
return Status::OK();
|
||||
}
|
||||
virtual Status Truncate(uint64_t /*size*/) { return Status::OK(); }
|
||||
virtual Status Close() = 0;
|
||||
virtual Status Flush() = 0;
|
||||
virtual Status Sync() = 0; // sync data
|
||||
|
@ -690,7 +689,7 @@ class WritableFile {
|
|||
}
|
||||
|
||||
// For documentation, refer to RandomAccessFile::GetUniqueId()
|
||||
virtual size_t GetUniqueId(char* id, size_t max_size) const {
|
||||
virtual size_t GetUniqueId(char* /*id*/, size_t /*max_size*/) const {
|
||||
return 0; // Default implementation to prevent issues with backwards
|
||||
}
|
||||
|
||||
|
@ -698,7 +697,7 @@ class WritableFile {
|
|||
// of this file. If the length is 0, then it refers to the end of file.
|
||||
// If the system is not caching the file contents, then this is a noop.
|
||||
// This call has no effect on dirty pages in the cache.
|
||||
virtual Status InvalidateCache(size_t offset, size_t length) {
|
||||
virtual Status InvalidateCache(size_t /*offset*/, size_t /*length*/) {
|
||||
return Status::NotSupported("InvalidateCache not supported.");
|
||||
}
|
||||
|
||||
|
@ -708,7 +707,9 @@ class WritableFile {
|
|||
// This asks the OS to initiate flushing the cached data to disk,
|
||||
// without waiting for completion.
|
||||
// Default implementation does nothing.
|
||||
virtual Status RangeSync(uint64_t offset, uint64_t nbytes) { return Status::OK(); }
|
||||
virtual Status RangeSync(uint64_t /*offset*/, uint64_t /*nbytes*/) {
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
// PrepareWrite performs any necessary preparation for a write
|
||||
// before the write actually occurs. This allows for pre-allocation
|
||||
|
@ -735,7 +736,7 @@ class WritableFile {
|
|||
}
|
||||
|
||||
// Pre-allocates space for a file.
|
||||
virtual Status Allocate(uint64_t offset, uint64_t len) {
|
||||
virtual Status Allocate(uint64_t /*offset*/, uint64_t /*len*/) {
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ class FilterBitsBuilder {
|
|||
#pragma warning(push)
|
||||
#pragma warning(disable : 4702) // unreachable code
|
||||
#endif
|
||||
virtual int CalculateNumEntry(const uint32_t space) {
|
||||
virtual int CalculateNumEntry(const uint32_t /*space*/) {
|
||||
#ifndef ROCKSDB_LITE
|
||||
throw std::runtime_error("CalculateNumEntry not Implemented");
|
||||
#else
|
||||
|
@ -122,7 +122,8 @@ class FilterPolicy {
|
|||
// Get the FilterBitsReader, which is ONLY used for full filter block
|
||||
// It contains interface to tell if key can be in filter
|
||||
// The input slice should NOT be deleted by FilterPolicy
|
||||
virtual FilterBitsReader* GetFilterBitsReader(const Slice& contents) const {
|
||||
virtual FilterBitsReader* GetFilterBitsReader(
|
||||
const Slice& /*contents*/) const {
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -379,8 +379,8 @@ class EventListener {
|
|||
// returns. Otherwise, RocksDB may be blocked.
|
||||
// @param handle is a pointer to the column family handle to be deleted
|
||||
// which will become a dangling pointer after the deletion.
|
||||
virtual void OnColumnFamilyHandleDeletionStarted(ColumnFamilyHandle* handle) {
|
||||
}
|
||||
virtual void OnColumnFamilyHandleDeletionStarted(
|
||||
ColumnFamilyHandle* /*handle*/) {}
|
||||
|
||||
// A call-back function for RocksDB which will be called after an external
|
||||
// file is ingested using IngestExternalFile.
|
||||
|
|
|
@ -97,7 +97,7 @@ class MemTableRep {
|
|||
//
|
||||
// Currently only skip-list based memtable implement the interface. Other
|
||||
// implementations will fallback to Insert() by default.
|
||||
virtual void InsertWithHint(KeyHandle handle, void** hint) {
|
||||
virtual void InsertWithHint(KeyHandle handle, void** /*hint*/) {
|
||||
// Ignore the hint by default.
|
||||
Insert(handle);
|
||||
}
|
||||
|
@ -149,8 +149,8 @@ class MemTableRep {
|
|||
virtual void Get(const LookupKey& k, void* callback_args,
|
||||
bool (*callback_func)(void* arg, const char* entry));
|
||||
|
||||
virtual uint64_t ApproximateNumEntries(const Slice& start_ikey,
|
||||
const Slice& end_key) {
|
||||
virtual uint64_t ApproximateNumEntries(const Slice& /*start_ikey*/,
|
||||
const Slice& /*end_key*/) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -66,11 +66,9 @@ class MergeOperator {
|
|||
// internal corruption. This will be treated as an error by the library.
|
||||
//
|
||||
// Also make use of the *logger for error messages.
|
||||
virtual bool FullMerge(const Slice& key,
|
||||
const Slice* existing_value,
|
||||
const std::deque<std::string>& operand_list,
|
||||
std::string* new_value,
|
||||
Logger* logger) const {
|
||||
virtual bool FullMerge(const Slice& /*key*/, const Slice* /*existing_value*/,
|
||||
const std::deque<std::string>& /*operand_list*/,
|
||||
std::string* /*new_value*/, Logger* /*logger*/) const {
|
||||
// deprecated, please use FullMergeV2()
|
||||
assert(false);
|
||||
return false;
|
||||
|
@ -145,9 +143,10 @@ class MergeOperator {
|
|||
// If there is corruption in the data, handle it in the FullMergeV2() function
|
||||
// and return false there. The default implementation of PartialMerge will
|
||||
// always return false.
|
||||
virtual bool PartialMerge(const Slice& key, const Slice& left_operand,
|
||||
const Slice& right_operand, std::string* new_value,
|
||||
Logger* logger) const {
|
||||
virtual bool PartialMerge(const Slice& /*key*/, const Slice& /*left_operand*/,
|
||||
const Slice& /*right_operand*/,
|
||||
std::string* /*new_value*/,
|
||||
Logger* /*logger*/) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -196,7 +195,7 @@ class MergeOperator {
|
|||
// during a point lookup, thereby helping in limiting the number of levels to
|
||||
// read from.
|
||||
// Doesn't help with iterators.
|
||||
virtual bool ShouldMerge(const std::vector<Slice>& operands) const {
|
||||
virtual bool ShouldMerge(const std::vector<Slice>& /*operands*/) const {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -45,7 +45,7 @@ class RateLimiter {
|
|||
// Request for token for bytes. If this request can not be satisfied, the call
|
||||
// is blocked. Caller is responsible to make sure
|
||||
// bytes <= GetSingleBurstBytes()
|
||||
virtual void Request(const int64_t bytes, const Env::IOPriority pri) {
|
||||
virtual void Request(const int64_t /*bytes*/, const Env::IOPriority /*pri*/) {
|
||||
assert(false);
|
||||
}
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ class PinnableSlice : public Slice, public Cleanable {
|
|||
}
|
||||
}
|
||||
|
||||
void remove_prefix(size_t n) {
|
||||
void remove_prefix(size_t /*n*/) {
|
||||
assert(0); // Not implemented
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ class SliceTransform {
|
|||
virtual bool InDomain(const Slice& key) const = 0;
|
||||
|
||||
// This is currently not used and remains here for backward compatibility.
|
||||
virtual bool InRange(const Slice& dst) const { return false; }
|
||||
virtual bool InRange(const Slice& /*dst*/) const { return false; }
|
||||
|
||||
// Transform(s)=Transform(`prefix`) for any s with `prefix` as a prefix.
|
||||
//
|
||||
|
@ -83,7 +83,7 @@ class SliceTransform {
|
|||
// "abcd,e", the file can be filtered out and the key will be invisible.
|
||||
//
|
||||
// i.e., an implementation always returning false is safe.
|
||||
virtual bool SameResultWhenAppended(const Slice& prefix) const {
|
||||
virtual bool SameResultWhenAppended(const Slice& /*prefix*/) const {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -597,7 +597,7 @@ class Statistics {
|
|||
virtual uint64_t getTickerCount(uint32_t tickerType) const = 0;
|
||||
virtual void histogramData(uint32_t type,
|
||||
HistogramData* const data) const = 0;
|
||||
virtual std::string getHistogramString(uint32_t type) const { return ""; }
|
||||
virtual std::string getHistogramString(uint32_t /*type*/) const { return ""; }
|
||||
virtual void recordTick(uint32_t tickerType, uint64_t count = 0) = 0;
|
||||
virtual void setTickerCount(uint32_t tickerType, uint64_t count) = 0;
|
||||
virtual uint64_t getAndResetTickerCount(uint32_t tickerType) = 0;
|
||||
|
|
|
@ -467,8 +467,8 @@ class TableFactory {
|
|||
// RocksDB prints configurations at DB Open().
|
||||
virtual std::string GetPrintableTableOptions() const = 0;
|
||||
|
||||
virtual Status GetOptionString(std::string* opt_string,
|
||||
const std::string& delimiter) const {
|
||||
virtual Status GetOptionString(std::string* /*opt_string*/,
|
||||
const std::string& /*delimiter*/) const {
|
||||
return Status::NotSupported(
|
||||
"The table factory doesn't implement GetOptionString().");
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ class GeoDB : public StackableDB {
|
|||
// GeoDB owns the pointer `DB* db` now. You should not delete it or
|
||||
// use it after the invocation of GeoDB
|
||||
// GeoDB(DB* db, const GeoDBOptions& options) : StackableDB(db) {}
|
||||
GeoDB(DB* db, const GeoDBOptions& options) : StackableDB(db) {}
|
||||
GeoDB(DB* db, const GeoDBOptions& /*options*/) : StackableDB(db) {}
|
||||
virtual ~GeoDB() {}
|
||||
|
||||
// Insert a new object into the location database. The object is
|
||||
|
|
|
@ -62,7 +62,7 @@ class OptimisticTransactionDB {
|
|||
|
||||
protected:
|
||||
// To Create an OptimisticTransactionDB, call Open()
|
||||
explicit OptimisticTransactionDB(DB* db) {}
|
||||
explicit OptimisticTransactionDB(DB* /*db*/) {}
|
||||
OptimisticTransactionDB() {}
|
||||
|
||||
private:
|
||||
|
|
|
@ -233,9 +233,9 @@ class Transaction {
|
|||
// An overload of the the above method that receives a PinnableSlice
|
||||
// For backward compatiblity a default implementation is provided
|
||||
virtual Status GetForUpdate(const ReadOptions& options,
|
||||
ColumnFamilyHandle* column_family,
|
||||
ColumnFamilyHandle* /*column_family*/,
|
||||
const Slice& key, PinnableSlice* pinnable_val,
|
||||
bool exclusive = true) {
|
||||
bool /*exclusive*/ = true) {
|
||||
if (pinnable_val == nullptr) {
|
||||
std::string* null_str = nullptr;
|
||||
return GetForUpdate(options, key, null_str);
|
||||
|
@ -440,8 +440,8 @@ class Transaction {
|
|||
|
||||
virtual bool IsDeadlockDetect() const { return false; }
|
||||
|
||||
virtual std::vector<TransactionID> GetWaitingTxns(uint32_t* column_family_id,
|
||||
std::string* key) const {
|
||||
virtual std::vector<TransactionID> GetWaitingTxns(
|
||||
uint32_t* /*column_family_id*/, std::string* /*key*/) const {
|
||||
assert(false);
|
||||
return std::vector<TransactionID>();
|
||||
}
|
||||
|
@ -469,7 +469,7 @@ class Transaction {
|
|||
uint64_t GetId() { return id_; }
|
||||
|
||||
protected:
|
||||
explicit Transaction(const TransactionDB* db) {}
|
||||
explicit Transaction(const TransactionDB* /*db*/) {}
|
||||
Transaction() : log_number_(0), txn_state_(STARTED) {}
|
||||
|
||||
// the log in which the prepared section for this txn resides
|
||||
|
|
|
@ -44,8 +44,8 @@ class WalFilter {
|
|||
// @params cf_name_id_map column_family_name to column_family_id map
|
||||
|
||||
virtual void ColumnFamilyLogNumberMap(
|
||||
const std::map<uint32_t, uint64_t>& cf_lognumber_map,
|
||||
const std::map<std::string, uint32_t>& cf_name_id_map) {}
|
||||
const std::map<uint32_t, uint64_t>& /*cf_lognumber_map*/,
|
||||
const std::map<std::string, uint32_t>& /*cf_name_id_map*/) {}
|
||||
|
||||
// LogRecord is invoked for each log record encountered for all the logs
|
||||
// during replay on logs on recovery. This method can be used to:
|
||||
|
@ -75,11 +75,9 @@ class WalFilter {
|
|||
// @returns Processing option for the current record.
|
||||
// Please see WalProcessingOption enum above for
|
||||
// details.
|
||||
virtual WalProcessingOption LogRecordFound(unsigned long long log_number,
|
||||
const std::string& log_file_name,
|
||||
const WriteBatch& batch,
|
||||
WriteBatch* new_batch,
|
||||
bool* batch_changed) {
|
||||
virtual WalProcessingOption LogRecordFound(
|
||||
unsigned long long /*log_number*/, const std::string& /*log_file_name*/,
|
||||
const WriteBatch& batch, WriteBatch* new_batch, bool* batch_changed) {
|
||||
// Default implementation falls back to older function for compatibility
|
||||
return LogRecord(batch, new_batch, batch_changed);
|
||||
}
|
||||
|
@ -87,9 +85,9 @@ class WalFilter {
|
|||
// Please see the comments for LogRecord above. This function is for
|
||||
// compatibility only and contains a subset of parameters.
|
||||
// New code should use the function above.
|
||||
virtual WalProcessingOption LogRecord(const WriteBatch& batch,
|
||||
WriteBatch* new_batch,
|
||||
bool* batch_changed) const {
|
||||
virtual WalProcessingOption LogRecord(const WriteBatch& /*batch*/,
|
||||
WriteBatch* /*new_batch*/,
|
||||
bool* /*batch_changed*/) const {
|
||||
return WalProcessingOption::kContinueProcessing;
|
||||
}
|
||||
|
||||
|
|
|
@ -217,8 +217,9 @@ class WriteBatch : public WriteBatchBase {
|
|||
}
|
||||
virtual void SingleDelete(const Slice& /*key*/) {}
|
||||
|
||||
virtual Status DeleteRangeCF(uint32_t column_family_id,
|
||||
const Slice& begin_key, const Slice& end_key) {
|
||||
virtual Status DeleteRangeCF(uint32_t /*column_family_id*/,
|
||||
const Slice& /*begin_key*/,
|
||||
const Slice& /*end_key*/) {
|
||||
return Status::InvalidArgument("DeleteRangeCF not implemented");
|
||||
}
|
||||
|
||||
|
@ -246,20 +247,20 @@ class WriteBatch : public WriteBatchBase {
|
|||
return Status::InvalidArgument("MarkBeginPrepare() handler not defined.");
|
||||
}
|
||||
|
||||
virtual Status MarkEndPrepare(const Slice& xid) {
|
||||
virtual Status MarkEndPrepare(const Slice& /*xid*/) {
|
||||
return Status::InvalidArgument("MarkEndPrepare() handler not defined.");
|
||||
}
|
||||
|
||||
virtual Status MarkNoop(bool empty_batch) {
|
||||
virtual Status MarkNoop(bool /*empty_batch*/) {
|
||||
return Status::InvalidArgument("MarkNoop() handler not defined.");
|
||||
}
|
||||
|
||||
virtual Status MarkRollback(const Slice& xid) {
|
||||
virtual Status MarkRollback(const Slice& /*xid*/) {
|
||||
return Status::InvalidArgument(
|
||||
"MarkRollbackPrepare() handler not defined.");
|
||||
}
|
||||
|
||||
virtual Status MarkCommit(const Slice& xid) {
|
||||
virtual Status MarkCommit(const Slice& /*xid*/) {
|
||||
return Status::InvalidArgument("MarkCommit() handler not defined.");
|
||||
}
|
||||
|
||||
|
|
|
@ -597,8 +597,8 @@ void HashCuckooRep::Iterator::Seek(const Slice& user_key,
|
|||
}
|
||||
|
||||
// Retreat to the last entry with a key <= target
|
||||
void HashCuckooRep::Iterator::SeekForPrev(const Slice& user_key,
|
||||
const char* memtable_key) {
|
||||
void HashCuckooRep::Iterator::SeekForPrev(const Slice& /*user_key*/,
|
||||
const char* /*memtable_key*/) {
|
||||
assert(false);
|
||||
}
|
||||
|
||||
|
@ -623,7 +623,7 @@ void HashCuckooRep::Iterator::SeekToLast() {
|
|||
|
||||
MemTableRep* HashCuckooRepFactory::CreateMemTableRep(
|
||||
const MemTableRep::KeyComparator& compare, Allocator* allocator,
|
||||
const SliceTransform* transform, Logger* logger) {
|
||||
const SliceTransform* /*transform*/, Logger* /*logger*/) {
|
||||
// The estimated average fullness. The write performance of any close hash
|
||||
// degrades as the fullness of the mem-table increases. Setting kFullness
|
||||
// to a value around 0.7 can better avoid write performance degradation while
|
||||
|
|
|
@ -362,14 +362,14 @@ class HashLinkListRep : public MemTableRep {
|
|||
|
||||
// Advance to the first entry with a key >= target
|
||||
virtual void Seek(const Slice& internal_key,
|
||||
const char* memtable_key) override {
|
||||
const char* /*memtable_key*/) override {
|
||||
node_ = hash_link_list_rep_->FindGreaterOrEqualInBucket(head_,
|
||||
internal_key);
|
||||
}
|
||||
|
||||
// Retreat to the last entry with a key <= target
|
||||
virtual void SeekForPrev(const Slice& internal_key,
|
||||
const char* memtable_key) override {
|
||||
virtual void SeekForPrev(const Slice& /*internal_key*/,
|
||||
const char* /*memtable_key*/) override {
|
||||
// Since we do not support Prev()
|
||||
// We simply do not support SeekForPrev
|
||||
Reset(nullptr);
|
||||
|
@ -483,10 +483,10 @@ class HashLinkListRep : public MemTableRep {
|
|||
}
|
||||
virtual void Next() override {}
|
||||
virtual void Prev() override {}
|
||||
virtual void Seek(const Slice& user_key,
|
||||
const char* memtable_key) override {}
|
||||
virtual void SeekForPrev(const Slice& user_key,
|
||||
const char* memtable_key) override {}
|
||||
virtual void Seek(const Slice& /*user_key*/,
|
||||
const char* /*memtable_key*/) override {}
|
||||
virtual void SeekForPrev(const Slice& /*user_key*/,
|
||||
const char* /*memtable_key*/) override {}
|
||||
virtual void SeekToFirst() override {}
|
||||
virtual void SeekToLast() override {}
|
||||
|
||||
|
|
|
@ -131,8 +131,8 @@ class HashSkipListRep : public MemTableRep {
|
|||
}
|
||||
|
||||
// Retreat to the last entry with a key <= target
|
||||
virtual void SeekForPrev(const Slice& internal_key,
|
||||
const char* memtable_key) override {
|
||||
virtual void SeekForPrev(const Slice& /*internal_key*/,
|
||||
const char* /*memtable_key*/) override {
|
||||
// not supported
|
||||
assert(false);
|
||||
}
|
||||
|
@ -219,10 +219,10 @@ class HashSkipListRep : public MemTableRep {
|
|||
}
|
||||
virtual void Next() override {}
|
||||
virtual void Prev() override {}
|
||||
virtual void Seek(const Slice& internal_key,
|
||||
const char* memtable_key) override {}
|
||||
virtual void SeekForPrev(const Slice& internal_key,
|
||||
const char* memtable_key) override {}
|
||||
virtual void Seek(const Slice& /*internal_key*/,
|
||||
const char* /*memtable_key*/) override {}
|
||||
virtual void SeekForPrev(const Slice& /*internal_key*/,
|
||||
const char* /*memtable_key*/) override {}
|
||||
virtual void SeekToFirst() override {}
|
||||
virtual void SeekToLast() override {}
|
||||
|
||||
|
@ -335,7 +335,7 @@ MemTableRep::Iterator* HashSkipListRep::GetDynamicPrefixIterator(Arena* arena) {
|
|||
|
||||
MemTableRep* HashSkipListRepFactory::CreateMemTableRep(
|
||||
const MemTableRep::KeyComparator& compare, Allocator* allocator,
|
||||
const SliceTransform* transform, Logger* logger) {
|
||||
const SliceTransform* transform, Logger* /*logger*/) {
|
||||
return new HashSkipListRep(compare, allocator, transform, bucket_count_,
|
||||
skiplist_height_, skiplist_branching_factor_);
|
||||
}
|
||||
|
|
|
@ -282,7 +282,7 @@ public:
|
|||
|
||||
MemTableRep* SkipListFactory::CreateMemTableRep(
|
||||
const MemTableRep::KeyComparator& compare, Allocator* allocator,
|
||||
const SliceTransform* transform, Logger* logger) {
|
||||
const SliceTransform* transform, Logger* /*logger*/) {
|
||||
return new SkipListRep(compare, allocator, transform, lookahead_);
|
||||
}
|
||||
|
||||
|
|
|
@ -227,8 +227,8 @@ void VectorRep::Iterator::Seek(const Slice& user_key,
|
|||
}
|
||||
|
||||
// Advance to the first entry with a key <= target
|
||||
void VectorRep::Iterator::SeekForPrev(const Slice& user_key,
|
||||
const char* memtable_key) {
|
||||
void VectorRep::Iterator::SeekForPrev(const Slice& /*user_key*/,
|
||||
const char* /*memtable_key*/) {
|
||||
assert(false);
|
||||
}
|
||||
|
||||
|
@ -296,7 +296,7 @@ MemTableRep::Iterator* VectorRep::GetIterator(Arena* arena) {
|
|||
|
||||
MemTableRep* VectorRepFactory::CreateMemTableRep(
|
||||
const MemTableRep::KeyComparator& compare, Allocator* allocator,
|
||||
const SliceTransform*, Logger* logger) {
|
||||
const SliceTransform*, Logger* /*logger*/) {
|
||||
return new VectorRep(compare, allocator, count_);
|
||||
}
|
||||
} // namespace rocksdb
|
||||
|
|
|
@ -725,7 +725,7 @@ Status RocksDBOptionsParser::VerifyRocksDBOptionsFromFile(
|
|||
|
||||
Status RocksDBOptionsParser::VerifyDBOptions(
|
||||
const DBOptions& base_opt, const DBOptions& persisted_opt,
|
||||
const std::unordered_map<std::string, std::string>* opt_map,
|
||||
const std::unordered_map<std::string, std::string>* /*opt_map*/,
|
||||
OptionsSanityCheckLevel sanity_check_level) {
|
||||
for (auto pair : db_options_type_info) {
|
||||
if (pair.second.verification == OptionVerificationType::kDeprecated) {
|
||||
|
|
|
@ -35,7 +35,7 @@ static int PthreadCall(const char* label, int result) {
|
|||
return result;
|
||||
}
|
||||
|
||||
Mutex::Mutex(bool adaptive) {
|
||||
Mutex::Mutex(bool /*adaptive*/) {
|
||||
#ifdef ROCKSDB_PTHREAD_ADAPTIVE_MUTEX
|
||||
if (!adaptive) {
|
||||
PthreadCall("init mutex", pthread_mutex_init(&mu_, nullptr));
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
namespace rocksdb {
|
||||
namespace port {
|
||||
void InstallStackTraceHandler() {}
|
||||
void PrintStack(int first_frames_to_skip) {}
|
||||
void PrintStack(int /*first_frames_to_skip*/) {}
|
||||
} // namespace port
|
||||
} // namespace rocksdb
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ Status AdaptiveTableFactory::NewTableReader(
|
|||
const TableReaderOptions& table_reader_options,
|
||||
unique_ptr<RandomAccessFileReader>&& file, uint64_t file_size,
|
||||
unique_ptr<TableReader>* table,
|
||||
bool prefetch_index_and_filter_in_cache) const {
|
||||
bool /*prefetch_index_and_filter_in_cache*/) const {
|
||||
Footer footer;
|
||||
auto s = ReadFooterFromFile(file.get(), nullptr /* prefetch_buffer */,
|
||||
file_size, &footer);
|
||||
|
|
|
@ -44,8 +44,9 @@ class AdaptiveTableFactory : public TableFactory {
|
|||
uint32_t column_family_id, WritableFileWriter* file) const override;
|
||||
|
||||
// Sanitizes the specified DB Options.
|
||||
Status SanitizeOptions(const DBOptions& db_opts,
|
||||
const ColumnFamilyOptions& cf_opts) const override {
|
||||
Status SanitizeOptions(
|
||||
const DBOptions& /*db_opts*/,
|
||||
const ColumnFamilyOptions& /*cf_opts*/) const override {
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ inline void BlockBasedFilterBlockBuilder::AddPrefix(const Slice& key) {
|
|||
}
|
||||
}
|
||||
|
||||
Slice BlockBasedFilterBlockBuilder::Finish(const BlockHandle& tmp,
|
||||
Slice BlockBasedFilterBlockBuilder::Finish(const BlockHandle& /*tmp*/,
|
||||
Status* status) {
|
||||
// In this impl we ignore BlockHandle
|
||||
*status = Status::OK();
|
||||
|
@ -185,8 +185,8 @@ BlockBasedFilterBlockReader::BlockBasedFilterBlockReader(
|
|||
}
|
||||
|
||||
bool BlockBasedFilterBlockReader::KeyMayMatch(
|
||||
const Slice& key, uint64_t block_offset, const bool no_io,
|
||||
const Slice* const const_ikey_ptr) {
|
||||
const Slice& key, uint64_t block_offset, const bool /*no_io*/,
|
||||
const Slice* const /*const_ikey_ptr*/) {
|
||||
assert(block_offset != kNotValid);
|
||||
if (!whole_key_filtering_) {
|
||||
return true;
|
||||
|
@ -195,8 +195,8 @@ bool BlockBasedFilterBlockReader::KeyMayMatch(
|
|||
}
|
||||
|
||||
bool BlockBasedFilterBlockReader::PrefixMayMatch(
|
||||
const Slice& prefix, uint64_t block_offset, const bool no_io,
|
||||
const Slice* const const_ikey_ptr) {
|
||||
const Slice& prefix, uint64_t block_offset, const bool /*no_io*/,
|
||||
const Slice* const /*const_ikey_ptr*/) {
|
||||
assert(block_offset != kNotValid);
|
||||
if (!prefix_extractor_) {
|
||||
return true;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue