Search in sources :

Example 1 with PipelineLogging

use of org.apache.hop.reflection.pipeline.transform.PipelineLogging in project hop by apache.

the class PipelineStartLoggingXp method executeLoggingPipeline.

private synchronized void executeLoggingPipeline(PipelineLog pipelineLog, String loggingPhase, String loggingPipelineFilename, IPipelineEngine<PipelineMeta> pipeline, IVariables variables) throws HopException {
    PipelineMeta loggingPipelineMeta = new PipelineMeta(loggingPipelineFilename, pipeline.getMetadataProvider(), true, variables);
    // Create a local pipeline engine...
    // 
    LocalPipelineEngine loggingPipeline = new LocalPipelineEngine(loggingPipelineMeta, variables, pipeline);
    // Flag it as a logging pipeline so we don't log ourselves...
    // 
    loggingPipeline.getExtensionDataMap().put(PIPELINE_LOGGING_FLAG, "Y");
    // Only log errors
    loggingPipeline.setLogLevel(LogLevel.ERROR);
    loggingPipeline.prepareExecution();
    // 
    for (TransformMetaDataCombi combi : loggingPipeline.getTransforms()) {
        if (combi.transform instanceof PipelineLogging) {
            PipelineLogging pipelineLogging = (PipelineLogging) combi.transform;
            pipelineLogging.setLoggingPipeline(pipeline);
            pipelineLogging.setLoggingPhase(loggingPhase);
        }
    }
    // Execute the logging pipeline to save the logging information
    // 
    loggingPipeline.startThreads();
    loggingPipeline.waitUntilFinished();
}
Also used : LocalPipelineEngine(org.apache.hop.pipeline.engines.local.LocalPipelineEngine) PipelineLogging(org.apache.hop.reflection.pipeline.transform.PipelineLogging) TransformMetaDataCombi(org.apache.hop.pipeline.transform.TransformMetaDataCombi) PipelineMeta(org.apache.hop.pipeline.PipelineMeta)

Aggregations

PipelineMeta (org.apache.hop.pipeline.PipelineMeta)1 LocalPipelineEngine (org.apache.hop.pipeline.engines.local.LocalPipelineEngine)1 TransformMetaDataCombi (org.apache.hop.pipeline.transform.TransformMetaDataCombi)1 PipelineLogging (org.apache.hop.reflection.pipeline.transform.PipelineLogging)1