-
Notifications
You must be signed in to change notification settings - Fork 51
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
HARMONY-2008: Fix query-cmr granule size parsing logic #699
Conversation
…eAndDistributionInformation size fields to get file size information for a granule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just the one question about missing units
granuleSizeInBytes += info.Size * 1024 * 1024 * 1024 * 1024 * 1024; | ||
break; | ||
default: | ||
logger.warn(`Unknown SizeUnit: ${info.SizeUnit}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We treat 0 as being unable to retrieve the size and handle it elsewhere in the work item updater code. I was just going to leave the behavior the same since we don't want to fail things when we cannot figure out the size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally
Jira Issue ID
HARMONY-2008
Description
Some providers use Size and SizeUnits in their CMR UMM-G metadata and others user SizeInBytes to specify the size of the granule files. This changes it to be able to correctly pull the size from either field. The UMM schema provides guidance that all providers should use SizeInBytes going forward, so if both are provided we use the SizeInBytes field.
Local Test Steps
npm run build
inservices/query-cmr
bin/restart-services
I performed performance testing in my sandbox - a 110K granule request took 10 minutes to complete all of the query-cmr tasks and populate all of the work items.
I then redeployed my sandbox pointing to production metadata and issued the original request for this ticket. Each query-cmr work item took between 11 and 28 seconds to populate 2000 work items. Previously each query-cmr work item was taking at least 3 minutes and as long as 30 minutes.
PR Acceptance Checklist