Search in sources :

Example 16 with Node

use of org.apache.nifi.atlas.emulator.Node in project nifi by apache.

the class ITReportLineageToAtlas method testMultipleProcessGroups.

@Test
public void testMultipleProcessGroups() throws Exception {
    final TestConfiguration tc = new TestConfiguration("MultipleProcessGroups");
    final ProvenanceRecords prs = tc.provenanceRecords;
    prs.add(pr("989dabb7-54b9-3c78", "ConsumeKafka_0_11", RECEIVE, "PLAINTEXT://0.kafka.example.com:6667/nifi-test"));
    prs.add(pr("767c7bd6-75e3-3f32", "PutHDFS", SEND, "hdfs://nn1.example.com:8020/user/nifi/5262553828219"));
    test(tc);
    waitNotificationsGetDelivered();
    final Lineage lineage = getLineage();
    final Node flow = lineage.findNode("nifi_flow", "MultipleProcessGroups", "MultipleProcessGroups@example");
    final Node path = lineage.findNode("nifi_flow_path", "ConsumeKafka_0_11, UpdateAttribute, PutHDFS", "989dabb7-54b9-3c78");
    final Node kafkaTopic = lineage.findNode("kafka_topic", "nifi-test@example");
    final Node hdfsPath = lineage.findNode("hdfs_path", "/user/nifi/5262553828219@example");
    lineage.assertLink(flow, path);
    lineage.assertLink(kafkaTopic, path);
    lineage.assertLink(path, hdfsPath);
}
Also used : EdgeNode(org.apache.nifi.provenance.lineage.EdgeNode) LineageNode(org.apache.nifi.provenance.lineage.LineageNode) EventNode(org.apache.nifi.provenance.lineage.EventNode) Node(org.apache.nifi.atlas.emulator.Node) Lineage(org.apache.nifi.atlas.emulator.Lineage) Test(org.junit.Test)

Example 17 with Node

use of org.apache.nifi.atlas.emulator.Node in project nifi by apache.

the class ITReportLineageToAtlas method testMultiInAndOuts.

@Test
public void testMultiInAndOuts() throws Exception {
    final TestConfiguration tc = new TestConfiguration("MultiInAndOuts");
    final ProvenanceRecords prs = tc.provenanceRecords;
    test(tc);
    waitNotificationsGetDelivered();
    final Lineage lineage = getLineage();
    final Node gen1 = lineage.findNode("nifi_flow_path", "Gen1", "a4bfe4ec-570b-3126");
    final Node gen2 = lineage.findNode("nifi_flow_path", "Gen2", "894218d5-dfe9-3ee5");
    final Node ua1 = lineage.findNode("nifi_flow_path", "UA1", "5609cb4f-8a95-3b7a");
    final Node ua2 = lineage.findNode("nifi_flow_path", "UA2", "6f88b3d9-5723-356a");
    final Node ua3 = lineage.findNode("nifi_flow_path", "UA3, UA4, LogAttribute", "3250aeb6-4026-3969");
    final Node ua1Q = lineage.findNode("nifi_queue", "queue", "5609cb4f-8a95-3b7a");
    final Node ua2Q = lineage.findNode("nifi_queue", "queue", "6f88b3d9-5723-356a");
    final Node ua3Q = lineage.findNode("nifi_queue", "queue", "3250aeb6-4026-3969");
    lineage.assertLink(gen1, ua1Q);
    lineage.assertLink(gen1, ua2Q);
    lineage.assertLink(gen2, ua2Q);
    lineage.assertLink(ua1Q, ua1);
    lineage.assertLink(ua2Q, ua2);
    lineage.assertLink(ua1, ua3Q);
    lineage.assertLink(ua2, ua3Q);
    lineage.assertLink(ua3Q, ua3);
}
Also used : EdgeNode(org.apache.nifi.provenance.lineage.EdgeNode) LineageNode(org.apache.nifi.provenance.lineage.LineageNode) EventNode(org.apache.nifi.provenance.lineage.EventNode) Node(org.apache.nifi.atlas.emulator.Node) Lineage(org.apache.nifi.atlas.emulator.Lineage) Test(org.junit.Test)

Aggregations

Lineage (org.apache.nifi.atlas.emulator.Lineage)17 Node (org.apache.nifi.atlas.emulator.Node)17 EdgeNode (org.apache.nifi.provenance.lineage.EdgeNode)17 EventNode (org.apache.nifi.provenance.lineage.EventNode)17 LineageNode (org.apache.nifi.provenance.lineage.LineageNode)17 Test (org.junit.Test)16 ComputeLineageResult (org.apache.nifi.provenance.lineage.ComputeLineageResult)4 Matchers.anyLong (org.mockito.Matchers.anyLong)4