Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix gap detector to update status #427

Merged
merged 2 commits into from
Jun 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions rust/processor/src/gap_detectors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@ pub async fn create_gap_detector_status_tracker_loop(

let mut default_gap_detector = DefaultGapDetector::new(starting_version);
let mut parquet_gap_detector = ParquetFileGapDetector::new(starting_version);
Comment on lines 52 to 53
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I missed this in the Parquet processor PR, but why do we need both of them here? Each processor only needs one gap detector right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah we just need one, maybe I can add a trait in processor to check isParquet, then just create a parquet gap detector. is it okay to address along with parquet feedbacks from dport?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could have create_gap_detector_status_tracker_loop take in a GapDetector and the processor choose which one to use.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or just create 2 separate loops.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah either one will be better creating both gap detectors. I think we can go with the former one, since we already have the enum


let mut last_update_time = std::time::Instant::now();
loop {
match gap_detector_receiver.recv().await {
Ok(ProcessingResult::DefaultProcessingResult(result)) => {
let last_update_time = std::time::Instant::now();
match default_gap_detector
.process_versions(ProcessingResult::DefaultProcessingResult(result))
{
Expand Down Expand Up @@ -87,6 +86,7 @@ pub async fn create_gap_detector_status_tracker_loop(
)
.await
.unwrap();
last_update_time = std::time::Instant::now();
}
}
},
Expand All @@ -112,7 +112,6 @@ pub async fn create_gap_detector_status_tracker_loop(
service_type = PROCESSOR_SERVICE_TYPE,
"[ParquetGapDetector] received parquet gap detector task",
);
let last_update_time = std::time::Instant::now();
match parquet_gap_detector
.process_versions(ProcessingResult::ParquetProcessingResult(result))
{
Expand Down Expand Up @@ -147,6 +146,7 @@ pub async fn create_gap_detector_status_tracker_loop(
)
.await
.unwrap();
last_update_time = std::time::Instant::now();
} else {
tracing::info!("Not Updating last processed version");
}
Expand Down
Loading