Search in sources :

Example 1 with ProgressNullMonitorListener

use of org.pentaho.di.core.ProgressNullMonitorListener in project pentaho-metaverse by pentaho.

the class MergeJoinStepAnalyzer method getInputFields.

@Override
public Map<String, RowMetaInterface> getInputFields(MergeJoinMeta meta) {
    Map<String, RowMetaInterface> rowMeta = null;
    try {
        validateState(null, meta);
    } catch (MetaverseAnalyzerException e) {
    // eat it
    }
    if (parentTransMeta != null) {
        rowMeta = new HashMap<>();
        try {
            StepMeta stepMeta1 = meta.getStepIOMeta().getInfoStreams().get(0).getStepMeta();
            ProgressNullMonitorListener progress = new ProgressNullMonitorListener();
            leftStepFields = parentTransMeta.getStepFields(stepMeta1, progress);
            progress.done();
            progress = new ProgressNullMonitorListener();
            StepMeta stepMeta2 = meta.getStepIOMeta().getInfoStreams().get(1).getStepMeta();
            rightStepFields = parentTransMeta.getStepFields(stepMeta2, progress);
            progress.done();
            rowMeta.put(stepMeta1.getName(), leftStepFields);
            rowMeta.put(stepMeta2.getName(), rightStepFields);
        } catch (Throwable t) {
        // eat it
        }
    }
    return rowMeta;
}
Also used : MetaverseAnalyzerException(org.pentaho.metaverse.api.MetaverseAnalyzerException) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ProgressNullMonitorListener(org.pentaho.di.core.ProgressNullMonitorListener) StepMeta(org.pentaho.di.trans.step.StepMeta) BaseStepMeta(org.pentaho.di.trans.step.BaseStepMeta)

Example 2 with ProgressNullMonitorListener

use of org.pentaho.di.core.ProgressNullMonitorListener in project pentaho-metaverse by pentaho.

the class TransExecutorStepAnalyzer method getOutputRowMetaInterfaces.

@Override
protected Map<String, RowMetaInterface> getOutputRowMetaInterfaces(TransExecutorMeta meta) {
    Map<String, RowMetaInterface> outputFields = new HashMap<>();
    String[] nextStepNames = parentTransMeta.getNextStepNames(parentStepMeta);
    for (int i = 0; i < nextStepNames.length; i++) {
        String nextStepName = nextStepNames[i];
        StepMeta step = parentTransMeta.findStep(nextStepName);
        ProgressNullMonitorListener progressMonitor = new ProgressNullMonitorListener();
        try {
            RowMetaInterface prevStepFields = parentTransMeta.getPrevStepFields(step, progressMonitor);
            outputFields.put(nextStepName, prevStepFields);
            progressMonitor.done();
        } catch (KettleStepException e) {
            log.warn("Could not get step fields for " + nextStepName, e);
        }
    }
    return outputFields;
}
Also used : KettleStepException(org.pentaho.di.core.exception.KettleStepException) HashMap(java.util.HashMap) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ProgressNullMonitorListener(org.pentaho.di.core.ProgressNullMonitorListener) StepMeta(org.pentaho.di.trans.step.StepMeta) BaseStepMeta(org.pentaho.di.trans.step.BaseStepMeta)

Example 3 with ProgressNullMonitorListener

use of org.pentaho.di.core.ProgressNullMonitorListener in project pentaho-metaverse by pentaho.

the class StepAnalyzer method getOutputFields.

@Override
public RowMetaInterface getOutputFields(T meta) {
    RowMetaInterface rmi = null;
    try {
        validateState(null, meta);
    } catch (MetaverseAnalyzerException e) {
    // eat it
    }
    if (parentTransMeta != null) {
        try {
            ProgressNullMonitorListener progressMonitor = new ProgressNullMonitorListener();
            rmi = parentTransMeta.getStepFields(parentStepMeta, progressMonitor);
            progressMonitor.done();
        } catch (KettleStepException e) {
            rmi = null;
        }
    }
    return rmi;
}
Also used : KettleStepException(org.pentaho.di.core.exception.KettleStepException) MetaverseAnalyzerException(org.pentaho.metaverse.api.MetaverseAnalyzerException) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ProgressNullMonitorListener(org.pentaho.di.core.ProgressNullMonitorListener)

Example 4 with ProgressNullMonitorListener

use of org.pentaho.di.core.ProgressNullMonitorListener in project pentaho-metaverse by pentaho.

the class StepAnalyzer method getInputFields.

@Override
public Map<String, RowMetaInterface> getInputFields(T meta) {
    Map<String, RowMetaInterface> rowMeta = null;
    try {
        validateState(null, meta);
    } catch (MetaverseAnalyzerException e) {
    // eat it
    }
    if (parentTransMeta != null) {
        try {
            rowMeta = new HashMap<String, RowMetaInterface>();
            ProgressNullMonitorListener progressMonitor = new ProgressNullMonitorListener();
            prevStepNames = parentTransMeta.getPrevStepNames(parentStepMeta);
            RowMetaInterface rmi = parentTransMeta.getPrevStepFields(parentStepMeta, progressMonitor);
            progressMonitor.done();
            if (!ArrayUtils.isEmpty(prevStepNames)) {
                rowMeta.put(prevStepNames[0], rmi);
            }
        } catch (KettleStepException e) {
            rowMeta = null;
        }
    }
    return rowMeta;
}
Also used : KettleStepException(org.pentaho.di.core.exception.KettleStepException) MetaverseAnalyzerException(org.pentaho.metaverse.api.MetaverseAnalyzerException) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ProgressNullMonitorListener(org.pentaho.di.core.ProgressNullMonitorListener)

Example 5 with ProgressNullMonitorListener

use of org.pentaho.di.core.ProgressNullMonitorListener in project pentaho-metaverse by pentaho.

the class JobExecutorStepAnalyzer method getOutputRowMetaInterfaces.

@Override
protected Map<String, RowMetaInterface> getOutputRowMetaInterfaces(JobExecutorMeta meta) {
    Map<String, RowMetaInterface> outputFields = new HashMap<>();
    String[] nextStepNames = parentTransMeta.getNextStepNames(parentStepMeta);
    for (int i = 0; i < nextStepNames.length; i++) {
        String nextStepName = nextStepNames[i];
        StepMeta step = parentTransMeta.findStep(nextStepName);
        ProgressNullMonitorListener progressMonitor = new ProgressNullMonitorListener();
        try {
            RowMetaInterface prevStepFields = parentTransMeta.getPrevStepFields(step, progressMonitor);
            outputFields.put(nextStepName, prevStepFields);
            progressMonitor.done();
        } catch (KettleStepException e) {
            log.warn("Could not get step fields for " + nextStepName, e);
        }
    }
    return outputFields;
}
Also used : KettleStepException(org.pentaho.di.core.exception.KettleStepException) HashMap(java.util.HashMap) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ProgressNullMonitorListener(org.pentaho.di.core.ProgressNullMonitorListener) StepMeta(org.pentaho.di.trans.step.StepMeta) BaseStepMeta(org.pentaho.di.trans.step.BaseStepMeta)

Aggregations

ProgressNullMonitorListener (org.pentaho.di.core.ProgressNullMonitorListener)6 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)5 KettleStepException (org.pentaho.di.core.exception.KettleStepException)4 BaseStepMeta (org.pentaho.di.trans.step.BaseStepMeta)3 StepMeta (org.pentaho.di.trans.step.StepMeta)3 MetaverseAnalyzerException (org.pentaho.metaverse.api.MetaverseAnalyzerException)3 HashMap (java.util.HashMap)2 IOException (java.io.IOException)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 FileObject (org.apache.commons.vfs2.FileObject)1 FileSystemException (org.apache.commons.vfs2.FileSystemException)1 KettleException (org.pentaho.di.core.exception.KettleException)1