mirror of https://github.com/apache/nifi.git
NIFI-2234: Fixed but that was overwriting the cluster node identifier in provenance events. This closes #633
This commit is contained in:
parent
8db89c8c0b
commit
3c49a93289
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue