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

Refactor processReport method in Worker class to remove system metadata related arguments #459

Open
doulikecookiedough opened this issue Jan 8, 2025 · 1 comment

Comments

@doulikecookiedough
Copy link

When processReport is executed, we are retrieving system metadata and related information from the message (QueueEntry). This should not be necessary because a quality check will be using hashstore directly to access the documents it needs to process a report.

Refactor processReport to remove the variables and code related to system metadata, data objects and its related documents so that calling classes do not need to provide this information.

@doulikecookiedough
Copy link
Author

doulikecookiedough commented Jan 10, 2025

Potential Optimization Point:

When processReport unpacks the QueueEntry message, it retrieves the String metadataDoc from the message and then creates a new InputStream input.

Then it passes the InputStream input to runSuite, in which runSuite converts it back to a String to be used when creating a new XMLDialect object.

// runSuite()
....
String content = IOUtils.toString(input, "UTF-8");
String metadataContent = content;

XMLDialect xml = new XMLDialect(IOUtils.toInputStream(metadataContent, "UTF-8"));

Investigate if runSuite is designed to accept InputStream as an arg because it expects various types of data to come in, as well as how the XMLDialect constructor works to create a new object. Refactor if it makes sense to simplify this code.

Related Issue:

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

No branches or pull requests

1 participant