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

[CIRCSTORE-526] Add ILR support for publishing batch request update events #489

Merged
merged 14 commits into from
Sep 16, 2024

Conversation

roman-barannyk
Copy link
Contributor

Resolves: CIRCSTORE-526

Copy link

sonarcloud bot commented Sep 11, 2024


batchResourceService.executeBatchUpdate(allDatabaseOperations, onFinishHandler)
.compose(v -> eventPublisher.publishCreated(payload.getInstanceId(), payload));
}

private RequestQueueReordering mapRequestsToPayload(List<Request> requests) {
var firstRequest = requests.get(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
var firstRequest = requests.get(0);
var firstRequest = requests.iterator().next();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we work with List in this method (not Collection), accessing an element by index will be more efficient for array-based implementation with constant time complexity O(1)

Comment on lines +257 to +258
assertRequestQueueReorderingEvent(instanceId.toString(),
requestsSorted.get(1).getString("itemId"), List.of(firstRequestId, secondRequestId), TITLE);
Copy link
Contributor

Choose a reason for hiding this comment

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

m.b. it's a good idea to extract constants ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

assertRequestQueueReorderingEvent is a universal method that is also applicable to queues with ITEM requestLevel requests

@roman-barannyk roman-barannyk merged commit 078733e into ecs-tlr-feature Sep 16, 2024
6 checks passed
@roman-barannyk roman-barannyk deleted the CIRCSTORE-526 branch September 16, 2024 14:17
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.

3 participants