Algorithm
writeDataJob(dataJobId, DataJobMetadata, DataJobWriteRequest) { Map<ProducerKey, Collection> producerKeyMap = new HashMap() FOR writeRequest in DataJobWriteRequest dataNode = inventoryPersistence.getCmHandleDataNodeByLongestMatchAlternateId(writeOperation.path()) ProducerKey prodKey = new ProducerKey( dataNode.dmiServiceName, dataProducerIdentifier) SubJob sjwr = createSubJob(DataJobMetadata, dataNode, dataJobId) // method to create the request if (producerKeyMap.contains(prodKey) // update the Map's collection with the new request else producerKeyMap.put(prodKey, sjwr) END FOR FOR value in producerKeyMap dmiUrl = DmiServiceUrlBuilder.createUrlForSubJob() // new method dmiRestClient.postOperation( value ) // send each collection of subjobs to the right DMI plugin END FOR }
- CPS-2142Getting issue details... STATUS
Set up
CM-Handle (by FDN) | DMI | Producer |
---|---|---|
ch-1 | DMI-A | p1 |
ch-2 | DMI-A | p1 |
ch-3 | DMI-A | p2 |
ch-4 | DMI-B | p1 |
Scenarios
Incoming Jobs Targets | Outgoing Requests[] | Notes | |||
---|---|---|---|---|---|
Outgoing Request | Outgoing Request | Outgoing Request | |||
1 | ch-1 | DMI-A → ch-1 | |||
2 | ch-1, ch-1 | DMI-A → ch-1, ch-1 | can have multiple jobs for same cm-handle | ||
3 | ch-1, ch-2 | DMI-A → ch-1, ch-2 | |||
4 | ch-1, ch-3 | DMI-A → ch-1 | DMI-A → ch-3 | even though same DMI is involved, since the producer (key) is different 2 outgoing jobs are required in this case | |
5 | ch-1, ch-4 | DMI-A → ch-1 | DMI-B → ch-4 | ||
6 | ch-1, ch-2, ch-3, ch-4 | DMI-A → ch-1, ch-2 | DMI-A → ch-3 | DMI-B → ch-4 | |
7 | ch-2, ch-3, ch-4, ch-1 | DMI-A → ch-2, ch-1 | DMI-A → ch-3 | DMI-B → ch-4 | note how the order of ch-2 and ch-1 is maintained in the outgoing request! |