class NotificationSender extends Object
NiFiAtlasHook for better testability.| Modifier and Type | Class and Description |
|---|---|
private class |
NotificationSender.Metrics |
| Modifier and Type | Field and Description |
|---|---|
private NiFiAtlasClient |
atlasClient |
private Map<String,String> |
guidToTypedQualifiedName
An index to resolve a qualifiedName from a GUID.
|
private static org.slf4j.Logger |
logger |
private Map<String,org.apache.atlas.v1.model.instance.Referenceable> |
typedQualifiedNameToRef
An index to resolve a Referenceable from a typeName::qualifiedName.
|
| Constructor and Description |
|---|
NotificationSender() |
| Modifier and Type | Method and Description |
|---|---|
private static <K,V> Map<K,V> |
createCache(int maxSize) |
private Predicate<org.apache.atlas.v1.model.instance.Referenceable> |
distinctReferenceable() |
private Map<String,org.apache.atlas.v1.model.instance.Referenceable> |
fromReferenceable(Object _refs,
NotificationSender.Metrics metrics) |
private boolean |
isAssigned(org.apache.atlas.v1.model.instance.Id id) |
private Collection<org.apache.atlas.v1.model.instance.Referenceable> |
mergeRefs(Collection<org.apache.atlas.v1.model.instance.Referenceable> r1,
Collection<org.apache.atlas.v1.model.instance.Referenceable> r2) |
private void |
mergeRefs(org.apache.atlas.v1.model.instance.Referenceable r1,
org.apache.atlas.v1.model.instance.Referenceable r2) |
private <K,V> List<V> |
safeGet(Map<K,List<V>> map,
K key) |
(package private) void |
send(List<org.apache.atlas.model.notification.HookNotification> messages,
BiConsumer<List<org.apache.atlas.model.notification.HookNotification>,org.apache.hadoop.security.UserGroupInformation> notifier)
Send hook notification messages.
|
(package private) void |
setAtlasClient(NiFiAtlasClient atlasClient) |
private Map<String,org.apache.atlas.v1.model.instance.Referenceable> |
toReferenceables(Object _refs,
NotificationSender.Metrics metrics)
Convert nifi_flow_path inputs or outputs to a map of Referenceable keyed by type + qualifiedName.
|
private static final org.slf4j.Logger logger
private NiFiAtlasClient atlasClient
private final Map<String,String> guidToTypedQualifiedName
private static <K,V> Map<K,V> createCache(int maxSize)
void setAtlasClient(NiFiAtlasClient atlasClient)
private Predicate<org.apache.atlas.v1.model.instance.Referenceable> distinctReferenceable()
private void mergeRefs(org.apache.atlas.v1.model.instance.Referenceable r1,
org.apache.atlas.v1.model.instance.Referenceable r2)
private Collection<org.apache.atlas.v1.model.instance.Referenceable> mergeRefs(Collection<org.apache.atlas.v1.model.instance.Referenceable> r1, Collection<org.apache.atlas.v1.model.instance.Referenceable> r2)
void send(List<org.apache.atlas.model.notification.HookNotification> messages, BiConsumer<List<org.apache.atlas.model.notification.HookNotification>,org.apache.hadoop.security.UserGroupInformation> notifier)
Send hook notification messages. In order to notify relationships between 'nifi_flow_path' and its inputs/outputs, this method sends messages in following order:
HookNotificationV1.EntityCreateRequest message:
Messages having the same type and qualified name will be de-duplicated before being sent.
messages - list of messages to be sentnotifier - responsible for sending notification messages, its accept method can be called multiple timesprivate Map<String,org.apache.atlas.v1.model.instance.Referenceable> toReferenceables(Object _refs, NotificationSender.Metrics metrics)
Convert nifi_flow_path inputs or outputs to a map of Referenceable keyed by type + qualifiedName.
Atlas removes existing references those are not specified when a collection attribute is updated. In order to preserve existing DataSet references, existing elements should be passed within a partial update message.
This method also populates entity cache for subsequent lookups.
_refs - Contains references from an existin nifi_flow_path entity inputs or outputs attribute.private Map<String,org.apache.atlas.v1.model.instance.Referenceable> fromReferenceable(Object _refs, NotificationSender.Metrics metrics)
private boolean isAssigned(org.apache.atlas.v1.model.instance.Id id)
Copyright © 2024 Apache NiFi Project. All rights reserved.