Skip to content

Adds Pagination on Backend#833

Merged
aaronzi merged 6 commits into
eclipse-basyx:mainfrom
FriedJannik:pagination
Aug 26, 2025
Merged

Adds Pagination on Backend#833
aaronzi merged 6 commits into
eclipse-basyx:mainfrom
FriedJannik:pagination

Conversation

@FriedJannik

@FriedJannik FriedJannik commented Aug 26, 2025

Copy link
Copy Markdown
Member

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.

@FriedJannik FriedJannik marked this pull request as ready for review August 26, 2025 08:35
@FriedJannik FriedJannik requested a review from aaronzi August 26, 2025 08:36
@aaronzi aaronzi requested a review from Copilot August 26, 2025 08:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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() and getShells() 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.

FriedJannik and others added 3 commits August 26, 2025 10:43
…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>
@aaronzi aaronzi merged commit 5149bfe into eclipse-basyx:main Aug 26, 2025
43 checks passed
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