Skip to content

Commit

Permalink
Add to-do items and reminder comments to 'Worker' class and revise lo…
Browse files Browse the repository at this point in the history
…gging statement to assist with debugging
  • Loading branch information
doulikecookiedough committed Jan 10, 2025
1 parent 7d5e6a4 commit 9a21412
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/main/java/edu/ucsb/nceas/mdqengine/Worker.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProp

String metadataPid = qEntry.getMetadataPid();
String suiteId = qEntry.getQualitySuiteId();
// TODO: Moving forward, sysmeta at this point should not be necessary
SystemMetadata sysmeta = qEntry.getSystemMetadata();
String nodeId = qEntry.getMemberNode();

Expand Down Expand Up @@ -206,8 +207,8 @@ public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProp

// Create the quality report
try {
// Set host name so controller can print stats info, referring to this
// worker.
// Set host name so controller can print stats info, referring to this worker.
// TODO: Reminder, qEntry will not have system metadata or metadata docs
qEntry.setHostname(InetAddress.getLocalHost().getHostName());
run = wkr.processReport(qEntry);
if (run.getObjectIdentifier() == null) {
Expand Down Expand Up @@ -326,6 +327,7 @@ public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProp
// if null is passed in.
String solrLocation = null;
log.debug("calling indexReport");
// TODO: Determine which system metadata values are required to index
wkr.indexReport(metadataPid, runXML, suiteId, sysmeta, solrLocation);

// Update any runs in this sequence that have been modified, either set as
Expand Down Expand Up @@ -549,12 +551,11 @@ public Run processReport(QueueEntry message) throws InterruptedException, Except
SystemMetadata sysmeta = message.getSystemMetadata();

log.info("Running suite '" + message.getQualitySuiteId() + "'" + " for metadata pid "
+ message.getMetadataPid());
+ message.getMetadataPid() + ", for metadataDoc: " + metadataDoc);
// Run the Metadata Quality Engine for the specified metadata object.
// TODO: set suite params correctly
// TODO: Review how suite params are set and possibly refactor
Map<String, Object> params = new HashMap<String, Object>();
// To run the suite, we need the in memory store, that contains all checks and
// suites.
// To run the suite, we need the in memory store, that contains all checks and suites.
MDQStore store = new InMemoryStore();

Run run = null;
Expand All @@ -568,6 +569,8 @@ public Run processReport(QueueEntry message) throws InterruptedException, Except
+ suiteId + e.getMessage(), e);
}

// TODO: System metadata is required for the solr index to obtain statistics/reports
// TODO: We will need a path to obtain the system metadata if its removed from qEntry
// Add DataONE sysmeta, if it was provided.
if (sysmeta != null) {
SysmetaModel smm = new SysmetaModel();
Expand Down

0 comments on commit 9a21412

Please sign in to comment.