DataSetLineageService implements LineageService { @Override @GraphTransaction public String getOutputsGraph(String datasetName) throws AtlasException { LOG.info("Fetching lineage outputs graph for datasetName={}", datasetName); datasetName = ParamChecker.notEmpty(datasetName, "dataset name"); TypeUtils.Pair<String, String> typeIdPair = validateDatasetNameExists(datasetName); return getOutputsGraphForId(typeIdPair.right); } @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 testGetOutputsGraphInvalidArguments(final String tableName, String expectedException) throws Exception { testInvalidArguments(expectedException, new Invoker() { @Override void run() throws AtlasException { lineageService.getOutputsGraph(tableName); } }); }
@Test(enabled = false) public void testGetOutputsGraph() throws Exception { JSONObject results = getOutputsGraph("sales_fact"); assertNotNull(results); System.out.println("outputs graph = " + results); JSONObject values = results.getJSONObject("values"); assertNotNull(values); final JSONObject vertices = values.getJSONObject("vertices"); Assert.assertEquals(vertices.length(), 3); final JSONObject edges = values.getJSONObject("edges"); Assert.assertEquals(edges.length(), 4); }