Skip to content

Commit

Permalink
Add rocksdb-cloud support, publicise VersionSet::LogReporter (#181)
Browse files Browse the repository at this point in the history
Related to tikv/rust-rocksdb#517 and #182
Adds code used in compiling with [rocksdb~6.4.tikv](https://github.com/tikv/rocksdb/tree/6.4.tikv) along with [rocksdb~6.4.cloud](https://github.com/tikv/rocksdb/tree/6.4.cloud)

- Makes public the struct LogReporter so that it can be accessed by [rocksdb~6.4.cloud/cloud/manifest_reader.cc#L114](https://github.com/tikv/rocksdb/blob/6a7c514453e3e3e1c3bb57c18d8e0280089ccdcd/cloud/manifest_reader.cc#L114)

Signed-off-by: Devdutt Shenoi <[email protected]>
Signed-off-by: tabokie <[email protected]>
  • Loading branch information
de-sh authored and tabokie committed May 12, 2022
1 parent 8e20349 commit 0559eac
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions db/version_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,15 @@ class VersionSet {
AppendVersion(cfd, version);
}

struct LogReporter : public log::Reader::Reporter {
Status* status;
virtual void Corruption(size_t /*bytes*/, const Status& s) override {
if (status->ok()) {
*status = s;
}
}
};

protected:
using VersionBuilderMap =
std::unordered_map<uint32_t,
Expand All @@ -1322,15 +1331,6 @@ class VersionSet {
friend class DBImpl;
friend class DBImplReadOnly;

struct LogReporter : public log::Reader::Reporter {
Status* status;
virtual void Corruption(size_t /*bytes*/, const Status& s) override {
if (status->ok()) {
*status = s;
}
}
};

void Reset();

// Returns approximated offset of a key in a file for a given version.
Expand Down

0 comments on commit 0559eac

Please sign in to comment.