Adds Pagination on Backend#833
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR migrates pagination logic from in-memory processing to database-level operations in MongoDB, improving performance and reducing memory overhead for larger datasets. The changes implement cursor-based pagination directly in MongoDB aggregation queries while maintaining backward compatibility with in-memory backends.
- Adds new
getSubmodels()andgetShells()methods to backend interfaces for paginated retrieval - Implements MongoDB-native pagination using aggregation pipelines with cursor and limit operations
- Refactors repository classes to delegate pagination to backend implementations
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| SubmodelOperations.java | Adds interface method for paginated submodel retrieval |
| MongoDbSubmodelOperations.java | Implements MongoDB-based pagination for submodels with aggregation pipeline |
| InMemorySubmodelBackend.java | Implements in-memory pagination fallback for submodels |
| CrudSubmodelRepository.java | Delegates pagination to backend implementation |
| AasOperations.java | Adds interface method for paginated AAS retrieval |
| MongoDBAasOperations.java | Implements MongoDB-based pagination for AAS with refactored filtering |
| InMemoryAasBackend.java | Implements in-memory pagination fallback for AAS |
| CrudAasRepository.java | Delegates pagination to backend implementation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…a/org/eclipse/digitaltwin/basyx/aasservice/backend/MongoDBAasOperations.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…rc/main/java/org/eclipse/digitaltwin/basyx/submodelservice/InMemorySubmodelBackend.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…va/org/eclipse/digitaltwin/basyx/aasservice/backend/InMemoryAasBackend.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR changes the pagination logic to leverage MongoDB for page calculation rather than performing it in-memory. This reduces memory overhead and improves query performance, especially with larger datasets.