use of io.openlineage.spark.agent.lifecycle.ContextFactory in project OpenLineage by OpenLineage.
the class OpenLineageSparkListener method onApplicationStart.
/**
* Check the {@link SparkConf} for open lineage configuration.
*
* @param applicationStart
*/
@Override
public void onApplicationStart(SparkListenerApplicationStart applicationStart) {
if (contextFactory != null) {
return;
}
SparkEnv sparkEnv = SparkEnv$.MODULE$.get();
if (sparkEnv != null) {
try {
ArgumentParser args = parseConf(sparkEnv.conf());
contextFactory = new ContextFactory(new EventEmitter(args));
} catch (URISyntaxException e) {
log.error("Unable to parse open lineage endpoint. Lineage events will not be collected", e);
}
} else {
log.warn("Open lineage listener instantiated, but no configuration could be found. " + "Lineage events will not be collected");
}
}
Aggregations