Skip to content

BEV-111 Use service param value for limiting rows fetched #66

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

Open
wants to merge 1 commit into
base: BEV-111-Set-limit-on-evets-query-db
Choose a base branch
from

Conversation

ole-v-v
Copy link
Contributor

@ole-v-v ole-v-v commented Aug 1, 2025

Suggestions from my code review.

  • Use the maxResults parameter provided in the service call to limit number of audit trails fetched from database.
  • Various code polish.

* @param model The model for the restriction for the extraction from the database.
* @param dbConnector The connector to the database, where the audit trails are to be extracted.
*/
public AuditDatabaseExtractor(ExtractModel model, DBConnector dbConnector) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ExtractModel isn’t visible outside the package, so no one could benefit from this constructor being public.

private List<Object> extractArgumentsFromModel() {
return Stream.of(model.getFileID(), model.getCollectionID(), model.getContributorID(),
model.getMinSeqNumber(), model.getMaxSeqNumber(), model.getActorName(),
model.getOperation() == null ? null : model.getOperation().toString(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not completely sure here. The method is much terser now, but these lines aren’t beautiful, so is it worth it? I generally clearly prefer readable code over short code.

Copy link
Contributor

Choose a reason for hiding this comment

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

Am i reading this right, that you are setting maxAuditTrails to 10.000? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am. It was unlimited before, so it should perform the same (or better if there are really more than 10 000 rows).

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.

2 participants