DataSetLineageService implements LineageService { @Override @GraphTransaction public String getInputsGraphForEntity(String guid) throws AtlasException { LOG.info("Fetching lineage inputs graph for entity={}", guid); guid = ParamChecker.notEmpty(guid, "Entity id"); validateDatasetExists(guid); return getInputsGraphForId(guid); } @Inject  DataSetLineageService(MetadataRepository metadataRepository,
                          GraphBackedDiscoveryService discoveryService,
                          AtlasGraph atlasGraph); @Override @GraphTransaction String getOutputsGraph(String datasetName); @Override @GraphTransaction String getInputsGraph(String tableName); @Override @GraphTransaction String getInputsGraphForEntity(String guid); @Override @GraphTransaction String getOutputsGraphForEntity(String guid); @Override @GraphTransaction String getSchema(String datasetName); @Override @GraphTransaction String getSchemaForEntity(String guid); static final String SELECT_INSTANCE_GUID; static final String DATASET_SCHEMA_QUERY_PREFIX; }
@Test(enabled = false) public void testGetInputsGraphForEntity() throws Exception { ITypedReferenceableInstance entity = repository.getEntityDefinition(HIVE_TABLE_TYPE, "name", "sales_fact_monthly_mv"); JSONObject results = new JSONObject(lineageService.getInputsGraphForEntity(entity.getId()._getId())); assertNotNull(results); System.out.println("inputs graph = " + results); JSONObject values = results.getJSONObject("values"); assertNotNull(values); final JSONObject vertices = values.getJSONObject("vertices"); Assert.assertEquals(vertices.length(), 4); final JSONObject edges = values.getJSONObject("edges"); Assert.assertEquals(edges.length(), 4); }