Skip to content

Commit

Permalink
Track each SST's timestamp information as user properties (facebook#8959
Browse files Browse the repository at this point in the history
)
  • Loading branch information
sunlike-Lipo committed Nov 8, 2021
1 parent 873c7ad commit 5991279
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions db/db_with_timestamp_basic_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -577,12 +577,12 @@ TEST_F(DBBasicTestWithTimestamp, GetTimestampTableProperties) {
ASSERT_EQ(2U, props.size());
for (const auto& item : props) {
auto& user_collected = item.second->user_collected_properties;
ASSERT_TRUE(user_collected.find("min_timestamp") !=
ASSERT_TRUE(user_collected.find("rocksdb.min_timestamp") !=
user_collected.end());
ASSERT_TRUE(user_collected.find("max_timestamp") !=
ASSERT_TRUE(user_collected.find("rocksdb.max_timestamp") !=
user_collected.end());
ASSERT_EQ(user_collected.at("min_timestamp"), Timestamp(0, 0));
ASSERT_EQ(user_collected.at("max_timestamp"), Timestamp(9, 0));
ASSERT_EQ(user_collected.at("rocksdb.min_timestamp"), Timestamp(0, 0));
ASSERT_EQ(user_collected.at("rocksdb.max_timestamp"), Timestamp(9, 0));
}
Close();
}
Expand Down
4 changes: 2 additions & 2 deletions db/table_properties_collector.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ class TimestampTablePropertiesCollector : public IntTblPropCollector {
Status Finish(UserCollectedProperties* properties) override {
assert(min_timestamp_.size() == max_timestamp_.size()
&& max_timestamp_.size() == cmp_->timestamp_size());
properties->insert({"min_timestamp", min_timestamp_});
properties->insert({"max_timestamp", max_timestamp_});
properties->insert({"rocksdb.min_timestamp", min_timestamp_});
properties->insert({"rocksdb.max_timestamp", max_timestamp_});
return Status::OK();
}

Expand Down

0 comments on commit 5991279

Please sign in to comment.