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);
}
}
}
}
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;
}
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()]);
}
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;
}
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;
}
}
}
Aggregations