Implement Async Records Mapping Mechanism for MARC Migration (Prepare Chunks)

Description

Overview:

Following the successful registration of MARC migration operations through the POST endpoint, this story focuses on implementing an asynchronous mechanism for mapping records. The objective is to prepare chunks of records with the first and last record IDs, facilitating efficient and incremental mapping processes.

Requirements/Scope:

  1. Develop an asynchronous mechanism for mapping records corresponding to the registered MARC migration operation.

  2. Prepare record chunks by identifying the first and last record IDs for mapping purposes.

Approach:

  1. Trigger Async Processing Post Operation Registration

    1. Initiate the asynchronous processing immediately after a new MARC migration operation is successfully registered.

    2. Implement configurable thread pool for execution (based on env var).

  2. Define Chunks and Determine Start/End Record IDs

    1. Design a mechanism to segment records into manageable chunks based on their identifiers.

    2. Determine the start and end record IDs for each chunk to facilitate incremental mapping.

  3. Create Database Table for Chunk Representation

    1. Establish a dedicated table within the database to represent and store the segmented chunks.

    2. Define the table structure to accommodate chunk-related information such as chunk ID, operation ID, start record ID, end record ID, etc.

  4. Persist Chunks to the Database Table:

    1. Develop the logic to save the identified chunks into the newly created table in the database.

    2. Ensure that each chunk's relevant information, including start and end record IDs, is accurately stored.

  5. Update Operation Status to DATA_MAPPING:

    1. Modify the status of the registered MARC migration operation to indicate that the data mapping process has commenced.

    2. Change the operation status to "DATA_MAPPING" to signify the transition to the mapping phase.

Additional info:
POC for defining chunks and mapping: https://github.com/folio-org/mod-entities-links/commits/MODELINKS-84-long-term-poc/

Acceptance Criteria:

  • covered by unit tests
     

Environment

None

Potential Workaround

None

Attachments

1

Checklist

hide

TestRail: Results

Activity

Show:

Valery_PilkoFebruary 8, 2024 at 8:57 AM

Verified on Snapshot environment.
GET endpoint returns new status: "data_mapping"
See attached screenshot:

Viacheslav KolesnykFebruary 7, 2024 at 12:42 PM

Note for testing: after some time GET endpoint should return operation with status “data mapping“

Done

Details

Assignee

Reporter

Priority

Story Points

Sprint

Development Team

Spitfire

Fix versions

Release

Quesnelia (R1 2024)

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created December 12, 2023 at 10:47 AM
Updated July 5, 2024 at 12:56 PM
Resolved February 8, 2024 at 12:09 PM
TestRail: Cases
TestRail: Runs