Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
hx235 committed Nov 8, 2023
1 parent 901c12f commit 8488c95
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions db/db_properties_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1084,12 +1084,14 @@ class CountingUserTblPropCollector : public TablePropertiesCollector {
const char* Name() const override { return "CountingUserTblPropCollector"; }

Status Finish(UserCollectedProperties* properties) override {
assert(!finish_called_);
std::string encoded;
PutVarint32(&encoded, count_);
*properties = UserCollectedProperties{
{"CountingUserTblPropCollector", message_},
{"Count", encoded},
};
finish_called_ = true;
return Status::OK();
}

Expand All @@ -1101,12 +1103,14 @@ class CountingUserTblPropCollector : public TablePropertiesCollector {
}

UserCollectedProperties GetReadableProperties() const override {
assert(finish_called_);
return UserCollectedProperties{};
}

private:
std::string message_ = "Rocksdb";
uint32_t count_ = 0;
bool finish_called_ = false;
};

class CountingUserTblPropCollectorFactory
Expand Down

0 comments on commit 8488c95

Please sign in to comment.