Search in sources :

Example 16 with Lineage

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

the class ITReportLineageToAtlas method testS2STransferAndGetCombination.

@Test
public void testS2STransferAndGetCombination() throws Exception {
    testS2STransfer();
    testS2SGet();
    final Lineage lineage = getLineage();
    final Node remoteFlow = lineage.findNode("nifi_flow", "S2STransfer", "S2STransfer@example");
    final Node localFlow = lineage.findNode("nifi_flow", "S2SGet", "S2SGet@example");
    final Node remoteGen = lineage.findNode("nifi_flow_path", "GenerateFlowFile, output", "1b9f81db-a0fd-389a");
    final Node outputPort = lineage.findNode("nifi_output_port", "output", "392e7343-3950-329b");
    final Node remoteOutputPortP = lineage.findNode("nifi_flow_path", "Remote Output Port", "7375f8f6-4604-468d");
    final Node queueL = lineage.findNode("nifi_queue", "queue", "97cc5b27-22f3-3c3b");
    final Node queueP = lineage.findNode("nifi_queue", "queue", "4f3bfa4c-6427-3aac");
    final Node queueU = lineage.findNode("nifi_queue", "queue", "bb530e58-ee14-3cac");
    final Node pathL = lineage.findNode("nifi_flow_path", "LogAttribute", "97cc5b27-22f3-3c3b");
    final Node pathP = lineage.findNode("nifi_flow_path", "PutFile", "4f3bfa4c-6427-3aac");
    final Node pathU = lineage.findNode("nifi_flow_path", "UpdateAttribute", "bb530e58-ee14-3cac");
    // Remote flow owns the outputPort and transfer data generated by GenerateFlowFile.
    lineage.assertLink(remoteFlow, remoteGen);
    lineage.assertLink(remoteGen, outputPort);
    // The Remote Output Port path in local flow gets data from the remote.
    lineage.assertLink(localFlow, remoteOutputPortP);
    lineage.assertLink(outputPort, remoteOutputPortP);
    lineage.assertLink(remoteOutputPortP, queueL);
    lineage.assertLink(remoteOutputPortP, queueP);
    lineage.assertLink(remoteOutputPortP, queueU);
    lineage.assertLink(queueL, pathL);
    lineage.assertLink(queueP, pathP);
    lineage.assertLink(queueU, pathU);
}
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 Lineage

use of org.apache.nifi.atlas.emulator.Lineage 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 18 with Lineage

use of org.apache.nifi.atlas.emulator.Lineage 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)18 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)17 ComputeLineageResult (org.apache.nifi.provenance.lineage.ComputeLineageResult)4 Matchers.anyLong (org.mockito.Matchers.anyLong)4