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

#303: Get flow checkpoints refactoring #304

Merged
merged 21 commits into from
Nov 27, 2024

Conversation

salamonpavel
Copy link
Collaborator

@salamonpavel salamonpavel commented Nov 21, 2024

Refactoring of get flow checkpoints endpoint. It newly returns also partitioning data and is sorted in descending order by checkpoint start time.
Closes #303

Release notes:

  • Get flow checkpoints endpoint refactored to reverse the order of data returned and to include partitioning data.

@salamonpavel
Copy link
Collaborator Author

Release notes:

  • Get flow checkpoints endpoint refactored to reverse the order of data returned and to include partitioning data.

Copy link

github-actions bot commented Nov 21, 2024

JaCoCo model module code coverage report - scala 2.13.11

Overall Project 59.69% 🍏

There is no coverage information present for the Files changed

Copy link

github-actions bot commented Nov 21, 2024

JaCoCo agent module code coverage report - scala 2.13.11

Overall Project 78.49% 🍏

There is no coverage information present for the Files changed

Copy link

github-actions bot commented Nov 21, 2024

JaCoCo reader module code coverage report - scala 2.13.11

Overall Project 100% 🍏

There is no coverage information present for the Files changed

Copy link

github-actions bot commented Nov 21, 2024

JaCoCo server module code coverage report - scala 2.13.11

Overall Project 68.39% -12.8% 🍏
Files changed 60.68%

File Coverage
FlowRepositoryImpl.scala 100% 🍏
FlowServiceImpl.scala 100% 🍏
FlowControllerImpl.scala 100% 🍏
CheckpointItemWithPartitioningFromDB.scala 69.04%
GetFlowCheckpoints.scala 53.28% -58.32%

@salamonpavel salamonpavel marked this pull request as ready for review November 21, 2024 10:57
@benedeki benedeki changed the title Feature/303 get flow checkpoints refactoring #303: Get flow checkpoints refactoring Nov 22, 2024
database/README.md Outdated Show resolved Hide resolved

object CheckpointItemWithPartitioningFromDB {

private def fromItemsToCheckpointWithPartitioningDTO(
Copy link
Contributor

Choose a reason for hiding this comment

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

Name suggestion:
Wouldn't be def groupCheckpoint be easier to understand?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't know. Naming is difficult...

Copy link
Contributor

Choose a reason for hiding this comment

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

That's true 😄

@benedeki benedeki requested a review from ABLL526 as a code owner November 22, 2024 21:01
benedeki
benedeki previously approved these changes Nov 25, 2024
Copy link
Contributor

@benedeki benedeki left a comment

Choose a reason for hiding this comment

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

  • code reviewed
  • pulled
  • built
  • run

ABLL526
ABLL526 previously approved these changes Nov 25, 2024
Copy link

@ABLL526 ABLL526 left a comment

Choose a reason for hiding this comment

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

Looks good to me.

checkpointStartTime: ZonedDateTime,
checkpointEndTime: Option[ZonedDateTime],
idPartitioning: Long,
partitioning: Json,
Copy link
Collaborator

Choose a reason for hiding this comment

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

possibly add code comment similar to the one above (the one on measurementValue )

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, added ...

runs.measure_definitions MD ON M.fk_measure_definition = MD.id_measure_definition
INNER JOIN
runs.partitionings P ON LC.fk_partitioning = P.id_partitioning
ORDER BY LC.process_start_time DESC;
Copy link
Collaborator

@lsulak lsulak Nov 25, 2024

Choose a reason for hiding this comment

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

Suggested change
ORDER BY LC.process_start_time DESC;
ORDER BY
CASE WHEN i_latest_first THEN LC.process_start_time DESC
ELSE LC.process_start_time ASC
END;

potentially this should work (pseudo-code, I haven't run it), also this solution would need to introduce 1 more input parameter i_latest_first (can be an optional parameter that is true by default) to the function and make change above on line 135

Copy link
Collaborator

Choose a reason for hiding this comment

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

also, don't we want to make checkpoints closer together by changing this ORDER BY to also contain checkpoint ID in it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it doesn't really matter since we need to process the data on the server anyway.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, added conditional ordering ...

Copy link
Collaborator

@lsulak lsulak left a comment

Choose a reason for hiding this comment

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

I fundamentally don't see any problem with this PR apart from the minor comments currently on it

@salamonpavel salamonpavel dismissed stale reviews from ABLL526 and benedeki via 728ee5d November 26, 2024 08:11
lsulak
lsulak previously approved these changes Nov 26, 2024
lsulak
lsulak previously approved these changes Nov 26, 2024
Copy link
Collaborator

@lsulak lsulak left a comment

Choose a reason for hiding this comment

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

Good job!

@@ -91,3 +91,4 @@ utils/resources/*.conf
/server/certs/
/server/selfsigned.crt
/server/selfsigned.p12
/.bloop/
Copy link
Contributor

Choose a reason for hiding this comment

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

❓😉

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't know which plugin/tool does that but there was .bloop folder generated which I believe shouldn't be part of VCS.

Comment on lines 139 to 143
WHEN i_latest_first THEN C.process_start_time
END DESC,
CASE
WHEN NOT i_latest_first THEN C.process_start_time
END ASC
Copy link
Contributor

Choose a reason for hiding this comment

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

This is tricky on NULL.
Would use an ELSE statement. And probably flip them. So the default is still DESC

Copy link
Contributor

Choose a reason for hiding this comment

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

Or just use a local variable at the beginning
_latest_first := coalesce(i_latest_first, TRUE);

Comment on lines 171 to 176
CASE
WHEN i_latest_first THEN LC.process_start_time
END DESC,
CASE
WHEN NOT i_latest_first THEN LC.process_start_time
END ASC;
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

used the coalesce

@salamonpavel salamonpavel merged commit 8603720 into master Nov 27, 2024
8 of 9 checks passed
@salamonpavel salamonpavel deleted the feature/303-get-flow-checkpoints-refactoring branch November 27, 2024 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GetFlowCheckpoints refactoring
4 participants