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

XWIKI-21922: Introduce methods to fetch a subset of revisions in XWikiVersioningStoreInterface #2925

Merged
merged 5 commits into from
Mar 6, 2024

Conversation

pjeanjean
Copy link
Contributor

Jira URL

https://jira.xwiki.org/browse/XWIKI-21922

Changes

Description

  • Introduce two new methods to XWikiVersioningStoreInterface: getXWikiDocVersions and getXWikiDocVersionsCount, both taking an instance of RevisionCriteria as parameter. They both have a default implementation that work by using the existing getXWikiDocVersions and filtering the results.
  • Introduce an implementations for both methods in XWikiHibernateVersioningStore.
  • Add the methods XWikiDocument.getRevisionsCount and Document.getRevisionsCount to expose the new count method.
  • Edit XWikiDocument.getRevisions(RevisionCriteria) to use the new fetch method. The existing filtering was used as a basis for the default implementation of XWikiVersioningStoreInterface.getXWikiDocVersions.
  • Move hibernate queries from XWikiHibernateVersioningStore to a new VersioningStoreQueryFactory class to even out class fan-out complexity.

Clarifications

Screenshots & Video

N/A

Executed Tests

A XWiki instance was run with the applied patches and everything was working as expected. A substantial speed-up was noticed in Velocity code using XWikiDocument.getRevisions for documents with more than 200k revisions.

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    • stable-15.10.x

…iVersioningStoreInterface

* Introduce default methods XWikiVersioningStoreInterface.getXWikiDocVersions and XWikiVersioningStoreInterface.getXWikiDocVersionsCount, taking RevisionCriteria as parameter
* Introduce implementations for both in XWikiHibernateVersioningStore
* Add XWikiDocument.getRevisionsCount and Document.getRevisionsCount
* Edit XWikiDocument.getRevisions(RevisionCriteria) to use the new method
* Move hibernate queries from XWikiHibernateVersioningStore to VersioningStoreQueryFactory to even out class fan-out complexity
…iVersioningStoreInterface

* Fix minor version filtering
* Improve style and documentation
@surli surli added the backport stable-15.10.x Used for automatic backport to 15.10.x branch. label Feb 26, 2024
…iVersioningStoreInterface

* Add new creation method to RevisionCriteriaFactory
* Other small improvements
…iVersioningStoreInterface

* Add VersioningStoreQueryFactoryTest
* Add XWikiVersioninStoreInterfaceTest
@pjeanjean
Copy link
Contributor Author

Should be good now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport stable-15.10.x Used for automatic backport to 15.10.x branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants