Search in sources :

Example 91 with StepInterface

use of org.pentaho.di.trans.step.StepInterface in project pentaho-kettle by pentaho.

the class TransPainter method drawStepStatusIndicator.

private void drawStepStatusIndicator(StepMeta stepMeta) {
    if (stepMeta == null) {
        return;
    }
    // draw status indicator
    if (trans != null) {
        Point pt = stepMeta.getLocation();
        if (pt == null) {
            pt = new Point(50, 50);
        }
        Point screen = real2screen(pt.x, pt.y);
        int x = screen.x;
        int y = screen.y;
        List<StepInterface> steps = trans.findBaseSteps(stepMeta.getName());
        for (StepInterface step : steps) {
            if (step.getStatus().equals(StepExecutionStatus.STATUS_FINISHED)) {
                gc.drawImage(EImage.TRUE, (x + iconsize) - (MINI_ICON_SIZE / 2) + 4, y - (MINI_ICON_SIZE / 2) - 1, magnification);
            }
        }
    }
}
Also used : StepInterface(org.pentaho.di.trans.step.StepInterface) Point(org.pentaho.di.core.gui.Point) KettleExtensionPoint(org.pentaho.di.core.extension.KettleExtensionPoint) Point(org.pentaho.di.core.gui.Point) KettleExtensionPoint(org.pentaho.di.core.extension.KettleExtensionPoint)

Example 92 with StepInterface

use of org.pentaho.di.trans.step.StepInterface in project pentaho-kettle by pentaho.

the class MappingInput method setConnectorSteps.

public void setConnectorSteps(StepInterface[] sourceSteps, List<MappingValueRename> valueRenames, String mappingStepname) {
    if (sourceSteps == null) {
        throw new IllegalArgumentException(BaseMessages.getString(PKG, "MappingInput.Exception.IllegalArgumentSourceStep"));
    }
    if (valueRenames == null) {
        throw new IllegalArgumentException(BaseMessages.getString(PKG, "MappingInput.Exception.IllegalArgumentValueRename"));
    }
    if (sourceSteps.length != 0) {
        if (mappingStepname == null) {
            throw new IllegalArgumentException(BaseMessages.getString(PKG, "MappingInput.Exception.IllegalArgumentStepName"));
        }
    }
    for (StepInterface sourceStep : sourceSteps) {
        // 
        if (!sourceStep.isMapping()) {
            // OK, before we leave, make sure there is a rowset that covers the path to this target step.
            // We need to create a new RowSet and add it to the Input RowSets of the target step
            // 
            BlockingRowSet rowSet = new BlockingRowSet(getTransMeta().getSizeRowset());
            // This is always a single copy, both for source and target...
            // 
            rowSet.setThreadNameFromToCopy(sourceStep.getStepname(), 0, mappingStepname, 0);
            // Make sure to connect it to both sides...
            // 
            sourceStep.addRowSetToOutputRowSets(rowSet);
            sourceStep.identifyErrorOutput();
            addRowSetToInputRowSets(rowSet);
        }
    }
    data.valueRenames = valueRenames;
    data.sourceSteps = sourceSteps;
}
Also used : StepInterface(org.pentaho.di.trans.step.StepInterface) BlockingRowSet(org.pentaho.di.core.BlockingRowSet)

Example 93 with StepInterface

use of org.pentaho.di.trans.step.StepInterface in project pentaho-kettle by pentaho.

the class Trans method findMappingOutput.

/**
 * Gets the mapping outputs for each step in the transformation.
 *
 * @return an array of MappingOutputs
 */
public MappingOutput[] findMappingOutput() {
    List<MappingOutput> list = new ArrayList<>();
    if (steps != null) {
        // Look in threads and find the MappingInput step thread...
        for (int i = 0; i < steps.size(); i++) {
            StepMetaDataCombi smdc = steps.get(i);
            StepInterface step = smdc.step;
            if (step.getStepID().equalsIgnoreCase("MappingOutput")) {
                list.add((MappingOutput) step);
            }
        }
    }
    return list.toArray(new MappingOutput[list.size()]);
}
Also used : StepInterface(org.pentaho.di.trans.step.StepInterface) ArrayList(java.util.ArrayList) StepMetaDataCombi(org.pentaho.di.trans.step.StepMetaDataCombi) MappingOutput(org.pentaho.di.trans.steps.mappingoutput.MappingOutput) KettleExtensionPoint(org.pentaho.di.core.extension.KettleExtensionPoint)

Example 94 with StepInterface

use of org.pentaho.di.trans.step.StepInterface in project pentaho-kettle by pentaho.

the class Trans method findRunThread.

/**
 * Find the run thread for the step with the specified name.
 *
 * @param stepname
 *          the step name
 * @return a StepInterface object corresponding to the run thread for the specified step
 */
public StepInterface findRunThread(String stepname) {
    if (steps == null) {
        return null;
    }
    for (int i = 0; i < steps.size(); i++) {
        StepMetaDataCombi sid = steps.get(i);
        StepInterface step = sid.step;
        if (step.getStepname().equalsIgnoreCase(stepname)) {
            return step;
        }
    }
    return null;
}
Also used : StepInterface(org.pentaho.di.trans.step.StepInterface) StepMetaDataCombi(org.pentaho.di.trans.step.StepMetaDataCombi) KettleExtensionPoint(org.pentaho.di.core.extension.KettleExtensionPoint)

Example 95 with StepInterface

use of org.pentaho.di.trans.step.StepInterface in project pentaho-kettle by pentaho.

the class Trans method killAllNoWait.

/**
 * Asks all steps to stop but doesn't wait around for it to happen. This is a special method for use with mappings.
 */
private void killAllNoWait() {
    if (steps == null) {
        return;
    }
    for (int i = 0; i < steps.size(); i++) {
        StepMetaDataCombi sid = steps.get(i);
        StepInterface step = sid.step;
        if (log.isDebug()) {
            log.logDebug(BaseMessages.getString(PKG, "Trans.Log.LookingAtStep") + step.getStepname());
        }
        step.stopAll();
        try {
            Thread.sleep(20);
        } catch (Exception e) {
            log.logError(BaseMessages.getString(PKG, "Trans.Log.TransformationErrors") + e.toString());
            return;
        }
    }
}
Also used : StepInterface(org.pentaho.di.trans.step.StepInterface) StepMetaDataCombi(org.pentaho.di.trans.step.StepMetaDataCombi) KettleExtensionPoint(org.pentaho.di.core.extension.KettleExtensionPoint) UnknownParamException(org.pentaho.di.core.parameters.UnknownParamException) KettleValueException(org.pentaho.di.core.exception.KettleValueException) KettleTransException(org.pentaho.di.core.exception.KettleTransException) DuplicateParamException(org.pentaho.di.core.parameters.DuplicateParamException) KettleFileException(org.pentaho.di.core.exception.KettleFileException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) KettleException(org.pentaho.di.core.exception.KettleException) KettleDatabaseException(org.pentaho.di.core.exception.KettleDatabaseException)

Aggregations

StepInterface (org.pentaho.di.trans.step.StepInterface)150 Trans (org.pentaho.di.trans.Trans)88 StepMeta (org.pentaho.di.trans.step.StepMeta)88 RowMetaAndData (org.pentaho.di.core.RowMetaAndData)75 TransMeta (org.pentaho.di.trans.TransMeta)73 PluginRegistry (org.pentaho.di.core.plugins.PluginRegistry)69 RowStepCollector (org.pentaho.di.trans.RowStepCollector)68 TransHopMeta (org.pentaho.di.trans.TransHopMeta)67 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)66 RowProducer (org.pentaho.di.trans.RowProducer)57 DummyTransMeta (org.pentaho.di.trans.steps.dummytrans.DummyTransMeta)50 InjectorMeta (org.pentaho.di.trans.steps.injector.InjectorMeta)49 Test (org.junit.Test)37 KettleException (org.pentaho.di.core.exception.KettleException)28 StepMetaDataCombi (org.pentaho.di.trans.step.StepMetaDataCombi)19 KettleExtensionPoint (org.pentaho.di.core.extension.KettleExtensionPoint)17 ArrayList (java.util.ArrayList)15 DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)14 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)14 RowSet (org.pentaho.di.core.RowSet)13