Search in sources :

Example 21 with Relation

use of co.cask.cdap.data2.metadata.lineage.Relation in project cdap by caskdata.

the class LineageCollapserTest method testCollapseRun.

@Test
public void testCollapseRun() throws Exception {
    Set<Relation> relations = ImmutableSet.of(new Relation(data1, flow1, AccessType.READ, runId1, ImmutableSet.of(flowlet11)), new Relation(data1, flow1, AccessType.WRITE, runId1, ImmutableSet.of(flowlet11)), new Relation(data1, flow1, AccessType.READ, runId2, ImmutableSet.of(flowlet11)));
    // Collapse on run
    Assert.assertEquals(toSet(new CollapsedRelation(data1, flow1, toSet(AccessType.READ), toSet(runId1, runId2), toSet(flowlet11)), new CollapsedRelation(data1, flow1, toSet(AccessType.WRITE), toSet(runId1), toSet(flowlet11))), LineageCollapser.collapseRelations(relations, ImmutableSet.of(CollapseType.RUN)));
}
Also used : CollapsedRelation(co.cask.cdap.data2.metadata.lineage.CollapsedRelation) CollapsedRelation(co.cask.cdap.data2.metadata.lineage.CollapsedRelation) Relation(co.cask.cdap.data2.metadata.lineage.Relation) Test(org.junit.Test)

Aggregations

Relation (co.cask.cdap.data2.metadata.lineage.Relation)20 Test (org.junit.Test)15 Lineage (co.cask.cdap.data2.metadata.lineage.Lineage)10 ProgramRunId (co.cask.cdap.proto.id.ProgramRunId)10 Store (co.cask.cdap.app.store.Store)7 LineageStore (co.cask.cdap.data2.metadata.lineage.LineageStore)7 MetadataStore (co.cask.cdap.data2.metadata.store.MetadataStore)7 DatasetId (co.cask.cdap.proto.id.DatasetId)7 ProgramId (co.cask.cdap.proto.id.ProgramId)6 RunId (org.apache.twill.api.RunId)6 CollapsedRelation (co.cask.cdap.data2.metadata.lineage.CollapsedRelation)5 StreamId (co.cask.cdap.proto.id.StreamId)5 MetadataRecord (co.cask.cdap.common.metadata.MetadataRecord)4 NamespaceId (co.cask.cdap.proto.id.NamespaceId)4 HashSet (java.util.HashSet)4 ApplicationId (co.cask.cdap.proto.id.ApplicationId)3 NamespacedEntityId (co.cask.cdap.proto.id.NamespacedEntityId)3 HashMap (java.util.HashMap)3 AllProgramsApp (co.cask.cdap.client.app.AllProgramsApp)2 RunRecordMeta (co.cask.cdap.internal.app.store.RunRecordMeta)2