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

fix: improve ingestion reprocessing flow #1392

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

JLargent42
Copy link
Contributor

This replaces part of the ingestion reprocess workflow's map to only operate on metadata.json files rather than looping through all objects.

The ingestion reprocess workflow has an inefficient state machine map to find metadata.json files. We can cut down on the number of state transitions by using a JSONPath regex filter instead.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@@ -481,22 +480,17 @@ class ReprocessIngestionWorkflow extends Construct {
.afterwards();

const process = new Map(this, 'Process Result', {
itemsPath: '$.response.Contents',
inputPath: `$.response.Contents[*][?(@.Key =~ /^.*${METADATA_KEY_SUFFIX}$/)]`,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Putting this into a variable would give it slightly more context, especially since JSONPath is not very readable IMO.

const METADATA_KEY_JSON_PATH_FILTER = `?(@.Key =~ /^.*${METADATA_KEY_SUFFIX}$/)`;
...
  inputPath: `$.response.Contents[*][${METADATA_KEY_JSON_PATH_FILTER}]`,

@cdklabs-automation cdklabs-automation added this pull request to the merge queue Feb 13, 2024
Merged via the queue into cdklabs:main with commit 441b979 Feb 13, 2024
7 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