Uploaded image for project: 'mod-data-export-worker'
  1. mod-data-export-worker
  2. MODEXPW-218

eHoldings: rework export job not to store all job data in-memory

    XMLWordPrintable

Details

    • Spitfire Sprint 149, Spitfire Sprint 150, Spitfire Sprint 151
    • 5
    • Spitfire
    • Nolana (R3 2022)
    • TBD

    Description

      Purpose/Overview:

      Currently eHoldings job looks like following:

      And the problem is that on "Save eHoldings step" all job related data is read from database and is stored in-memory till the end of the step. Furthermore, even bigger object is constructed during this step in order to support required export format. This uses huge amount of RAM during big exports (f.e. package with some notes + 10k titles).

      Earlier this was the only way we can calculate the number of columns in result file, as we need to query all titles first to count maximum amount of notes they have in order to define number of columns.

      As of https://issues.folio.org/browse/MODEXPW-198 postgres database is introduced and RAM usage can be decreased significantly.

      Approach:

      Don't store job-related data (packages, titles, notes) in job context.

      Save job-related data in postgres after each read.

      Calculate desired number of columns by postgres query.

      Create result file with necessary column headers.

      Read data from postgres in batches and write it to a file in a single step.

      Clean up job data in database.

      Acceptance criteria:

      • Functionality implemented
      • Result file remains the same
      • Covered with unit tests
      • Huge jobs successfully finish even on environments with limited resources

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                GurleenKaur Gurleen Kaur
                viacheslav_kolesnyk Viacheslav Kolesnyk
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases