use of io.cdap.cdap.data.ProgramContext in project cdap by caskdata.
the class LineageWriterDatasetFramework method doWriteLineage.
private void doWriteLineage(DatasetId datasetInstanceId, AccessType accessType) {
ProgramContext programContext = this.programContext;
if (programContext != null) {
ProgramRunId programRunId = programContext.getProgramRunId();
NamespacedEntityId componentId = programContext.getComponentId();
try {
lineageWriter.addAccess(programRunId, datasetInstanceId, accessType, componentId);
} catch (Throwable t) {
// Failure to write to lineage shouldn't cause dataset operation failure
LOG.warn("Failed to write lineage information for dataset {} with access type {} from {},{}", datasetInstanceId, accessType, programRunId, componentId);
// Log the stacktrace as debug to not polluting the log
LOG.debug("Cause for lineage writing failure for {} {} {} {}", datasetInstanceId, accessType, programRunId, componentId, t);
}
}
}
Aggregations