mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-09 06:31:41 +02:00
Squashed 'src/leveldb/' changes from 4188247086..113db4962b
113db4962b Merge bitcoin-core/leveldb-subtree#51: refactor: add missing overrides 9defe8494a refactor: add missing overrides git-subtree-dir: src/leveldb git-subtree-split: 113db4962b8be416c17ad2b4bdcc5514c51d7181
This commit is contained in:
parent
a130bbd154
commit
e2c84b896f
6
db/c.cc
6
db/c.cc
@ -471,11 +471,11 @@ leveldb_filterpolicy_t* leveldb_filterpolicy_create_bloom(int bits_per_key) {
|
|||||||
static void DoNothing(void*) {}
|
static void DoNothing(void*) {}
|
||||||
|
|
||||||
~Wrapper() { delete rep_; }
|
~Wrapper() { delete rep_; }
|
||||||
const char* Name() const { return rep_->Name(); }
|
const char* Name() const override { return rep_->Name(); }
|
||||||
void CreateFilter(const Slice* keys, int n, std::string* dst) const {
|
void CreateFilter(const Slice* keys, int n, std::string* dst) const override {
|
||||||
return rep_->CreateFilter(keys, n, dst);
|
return rep_->CreateFilter(keys, n, dst);
|
||||||
}
|
}
|
||||||
bool KeyMayMatch(const Slice& key, const Slice& filter) const {
|
bool KeyMayMatch(const Slice& key, const Slice& filter) const override {
|
||||||
return rep_->KeyMayMatch(key, filter);
|
return rep_->KeyMayMatch(key, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ class SpecialEnv : public EnvWrapper {
|
|||||||
public:
|
public:
|
||||||
DataFile(SpecialEnv* env, WritableFile* base) : env_(env), base_(base) {}
|
DataFile(SpecialEnv* env, WritableFile* base) : env_(env), base_(base) {}
|
||||||
~DataFile() { delete base_; }
|
~DataFile() { delete base_; }
|
||||||
Status Append(const Slice& data) {
|
Status Append(const Slice& data) override {
|
||||||
if (env_->no_space_.load(std::memory_order_acquire)) {
|
if (env_->no_space_.load(std::memory_order_acquire)) {
|
||||||
// Drop writes on the floor
|
// Drop writes on the floor
|
||||||
return Status::OK();
|
return Status::OK();
|
||||||
@ -147,9 +147,9 @@ class SpecialEnv : public EnvWrapper {
|
|||||||
return base_->Append(data);
|
return base_->Append(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Status Close() { return base_->Close(); }
|
Status Close() override { return base_->Close(); }
|
||||||
Status Flush() { return base_->Flush(); }
|
Status Flush() override { return base_->Flush(); }
|
||||||
Status Sync() {
|
Status Sync() override {
|
||||||
if (env_->data_sync_error_.load(std::memory_order_acquire)) {
|
if (env_->data_sync_error_.load(std::memory_order_acquire)) {
|
||||||
return Status::IOError("simulated data sync error");
|
return Status::IOError("simulated data sync error");
|
||||||
}
|
}
|
||||||
@ -168,16 +168,16 @@ class SpecialEnv : public EnvWrapper {
|
|||||||
public:
|
public:
|
||||||
ManifestFile(SpecialEnv* env, WritableFile* b) : env_(env), base_(b) {}
|
ManifestFile(SpecialEnv* env, WritableFile* b) : env_(env), base_(b) {}
|
||||||
~ManifestFile() { delete base_; }
|
~ManifestFile() { delete base_; }
|
||||||
Status Append(const Slice& data) {
|
Status Append(const Slice& data) override {
|
||||||
if (env_->manifest_write_error_.load(std::memory_order_acquire)) {
|
if (env_->manifest_write_error_.load(std::memory_order_acquire)) {
|
||||||
return Status::IOError("simulated writer error");
|
return Status::IOError("simulated writer error");
|
||||||
} else {
|
} else {
|
||||||
return base_->Append(data);
|
return base_->Append(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Status Close() { return base_->Close(); }
|
Status Close() override { return base_->Close(); }
|
||||||
Status Flush() { return base_->Flush(); }
|
Status Flush() override { return base_->Flush(); }
|
||||||
Status Sync() {
|
Status Sync() override {
|
||||||
if (env_->manifest_sync_error_.load(std::memory_order_acquire)) {
|
if (env_->manifest_sync_error_.load(std::memory_order_acquire)) {
|
||||||
return Status::IOError("simulated sync error");
|
return Status::IOError("simulated sync error");
|
||||||
} else {
|
} else {
|
||||||
|
@ -205,7 +205,7 @@ class LogTest {
|
|||||||
|
|
||||||
return Status::OK();
|
return Status::OK();
|
||||||
}
|
}
|
||||||
std::string GetName() const { return ""; }
|
std::string GetName() const override { return ""; }
|
||||||
|
|
||||||
Slice contents_;
|
Slice contents_;
|
||||||
bool force_error_;
|
bool force_error_;
|
||||||
|
@ -129,7 +129,7 @@ class StringSource : public RandomAccessFile {
|
|||||||
return Status::OK();
|
return Status::OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string GetName() const { return ""; }
|
std::string GetName() const override { return ""; }
|
||||||
private:
|
private:
|
||||||
std::string contents_;
|
std::string contents_;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user