Skip to content

Commit

Permalink
Make last_modified_time range configurable within redex
Browse files Browse the repository at this point in the history
Summary: Currently the last modified time decisions are still made in data pipeline, this is to support a pass-through last_modified_time and filter within the redex pass. The corresponding data pipeline change is D56013844.

Reviewed By: NTillmann

Differential Revision: D56013136

fbshipit-source-id: 9c8c1e8b972b9064847c0eded0a51213b0ac234d
  • Loading branch information
Jidong Chen authored and facebook-github-bot committed Apr 16, 2024
1 parent a811fe5 commit 8f3e60f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libredex/ConfigFiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,11 @@ void ConfigFiles::build_dead_class_and_live_class_split_lists() {
DeadClassLoadCounts load_counts;
StringTabSplitter splitter(line);
std::string_view classname = splitter.get();
const uint32_t k_num_remaining_columns = 4;
const uint32_t k_num_remaining_columns = 5;
std::array<int64_t*, k_num_remaining_columns> columns = {
&load_counts.sampled, &load_counts.unsampled,
&load_counts.beta_unsampled, &load_counts.last_modified_count};
&load_counts.beta_unsampled, &load_counts.last_modified_count,
&load_counts.seconds_since_last_modified};
for (uint32_t i = 0; splitter.next() && i < k_num_remaining_columns;
i++) {
from_chars(splitter.get(), columns[i]);
Expand Down
7 changes: 7 additions & 0 deletions libredex/ConfigFiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ struct ConfigFiles {
int64_t last_modified_count{1}; // number of times that last modified time
// fall into acceptable range. Default value
// 1 is for backward compatibility.
// The number of seconds since last
// time the file of this class was modified.
// 0 is for backward compatibility, meaning data not available.
// This will be passed in by the data pipeline, the value is calculated by
// timestamp_of_datapipe_ds - last_modified which is deterministic at given
// ds
int64_t seconds_since_last_modified{0};
};

const std::unordered_map<std::string, DeadClassLoadCounts>&
Expand Down

0 comments on commit 8f3e60f

Please sign in to comment.