Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-20357

Make ThumbnailFolderishFactory more scalable

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 7.10-HF14
    • Fix Version/s: 7.10-HF17, 8.10
    • Component/s: Thumbnail Service
    • Tags:
    • Sprint:
      nxfit 8.4.5, nxfit 8.4.6, nxfit 8.4.7
    • Story Points:
      2

      Description

      The default ThumbnailFolderishFactory in 7.10 contains code that is not good when it comes to scalability.

      The fault code is actually :

         if (session.hasChildren(docRef)) {
              DocumentModel child = session.getChildren(docRef).get(0);
              if (!child.isFolder()) {
                  return session.getChildren(docRef).get(0).getAdapter(ThumbnailAdapter.class).getThumbnail(session);
              }
          }
      

      It means that when computing the thumbnail of a Folderish document the current code will call getChildren twice:

      • this is bad to do the call twice
      • call getChildren is costly when the folder is big (there is no batching so it will fetch all children from the DB and load them into memory)

      To work around that we should : so a simple NXQL query

      • filtering on ecm:parentId
      • giving a max entries of 1
      • not using any ordering (otherzise the DB still needs to read all the children)

      On master, this factory does not seem to exist anymore, but this is worth checking the real current implementation.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: