NIFI-2234: Fixed but that was overwriting the cluster node identifier in provenance events. This closes #633

This commit is contained in:
Mark Payne 2016-07-12 17:23:40 -04:00 committed by Matt Gilman
parent 8db89c8c0b
commit 3c49a93289
1 changed files with 11 additions and 4 deletions

View File

@ -98,10 +98,17 @@ public class ProvenanceQueryEndpointMerger implements EndpointResponseMerger {
// populate the cluster identifier // populate the cluster identifier
for (final ProvenanceEventDTO eventDto : nodeResultDto.getProvenanceEvents()) { for (final ProvenanceEventDTO eventDto : nodeResultDto.getProvenanceEvents()) {
// if the cluster node id or node address is not set, then we need to populate them. If they
// are already set, we don't want to populate them because it will be the case that they were populated
// by the Cluster Coordinator when it federated the request, and we are now just receiving the response
// from the Cluster Coordinator.
if (eventDto.getClusterNodeId() == null || eventDto.getClusterNodeAddress() == null) {
eventDto.setClusterNodeId(nodeIdentifier.getId()); eventDto.setClusterNodeId(nodeIdentifier.getId());
eventDto.setClusterNodeAddress(nodeAddress); eventDto.setClusterNodeAddress(nodeAddress);
// add node identifier to the event's id so that it is unique across cluster // add node identifier to the event's id so that it is unique across cluster
eventDto.setId(nodeIdentifier.getId() + eventDto.getId()); eventDto.setId(nodeIdentifier.getId() + eventDto.getId());
}
allResults.add(eventDto); allResults.add(eventDto);
} }
} }