Open zhenyoung opened 1 month ago
For creation time, we have file_creation_time
in the MANIFEST AddFile entry. For deletion time, you could approximate it using the latest file_creation_time
seen before the DeleteFile entry. That's what https://github.com/ZonedStorage/rocksdb_trace_translator does.
In my study(level compcation style), I define the lifetim of SSTable as the time interval between two compactions.
definition
For example, the first compaction output the sst1, and the timestamp of this time is its created_time. When the second compaction is triggered which selects sst1 as one of victim in this compaction, and the timestamp of this time is its death_time. So the result of
death_time - created_time
is the lifetime of this sst1.I have added two fields
created_time
anddeath_time
to thetable_properties.h
doubts
To record created_time, I have add the following code in
BlockBasedTableBuilder::WritePropertiesBlock()
ofblock_based_table_builder.cc
while writing properties block to storage.And I want to record death_time at the end of
PickCompaction()
incompaction_picker_level.cc
.I want to get information from this c instance and set death_time field.
But I'm not sure whether the properties of SSTable can be modified or not this time. And how to write code to set this death_time property?