use of org.pentaho.di.trans.step.StepMetaDataCombi in project pentaho-kettle by pentaho.
the class Trans method findDataInterface.
/**
* Find the data interface for the step with the specified name.
*
* @param name
* the step name
* @return the step data interface
*/
public StepDataInterface findDataInterface(String name) {
if (steps == null) {
return null;
}
for (int i = 0; i < steps.size(); i++) {
StepMetaDataCombi sid = steps.get(i);
StepInterface rt = sid.step;
if (rt.getStepname().equalsIgnoreCase(name)) {
return sid.data;
}
}
return null;
}
use of org.pentaho.di.trans.step.StepMetaDataCombi in project pentaho-kettle by pentaho.
the class Trans method findMappingInput.
/**
* Gets the mapping inputs for each step in the transformation.
*
* @return an array of MappingInputs
*/
public MappingInput[] findMappingInput() {
if (steps == null) {
return null;
}
List<MappingInput> list = new ArrayList<>();
// 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("MappingInput")) {
list.add((MappingInput) step);
}
}
return list.toArray(new MappingInput[list.size()]);
}
use of org.pentaho.di.trans.step.StepMetaDataCombi in project pentaho-kettle by pentaho.
the class Trans method findStepInterface.
/**
* Find the executing step copy for the step with the specified name and copy number
*
* @param stepname
* the step name
* @param copynr
* @return the executing step found or null if no copy could be found.
*/
public StepInterface findStepInterface(String stepname, int copyNr) {
if (steps == null) {
return null;
}
for (int i = 0; i < steps.size(); i++) {
StepMetaDataCombi sid = steps.get(i);
StepInterface stepInterface = sid.step;
if (stepInterface.getStepname().equalsIgnoreCase(stepname) && sid.copy == copyNr) {
return stepInterface;
}
}
return null;
}
use of org.pentaho.di.trans.step.StepMetaDataCombi in project pentaho-kettle by pentaho.
the class Trans method getEnded.
/**
* Gets the number of steps in the transformation that are in an end state, such as Finished, Halted, or Stopped.
*
* @return the number of ended steps
*/
public int getEnded() {
int nrEnded = 0;
if (steps == null) {
return 0;
}
for (int i = 0; i < steps.size(); i++) {
StepMetaDataCombi sid = steps.get(i);
StepDataInterface data = sid.data;
if ((sid.step != null && !sid.step.isRunning()) || // Should normally not be needed anymore, status is kept in data.
data.getStatus() == // Finished processing
StepExecutionStatus.STATUS_FINISHED || // Not launching because of init error
data.getStatus() == StepExecutionStatus.STATUS_HALTED || // Stopped because of an error
data.getStatus() == StepExecutionStatus.STATUS_STOPPED) {
nrEnded++;
}
}
return nrEnded;
}
use of org.pentaho.di.trans.step.StepMetaDataCombi in project pentaho-kettle by pentaho.
the class TransPartitioningTest method getStepByName.
private StepInterface getStepByName(String name) {
List<StepMetaDataCombi> combiList = trans.getSteps();
for (StepMetaDataCombi item : combiList) {
if (item.step.toString().equals(name)) {
return item.step;
}
}
fail("Test error, can't find step with name: " + name);
// and this will never happens.
return null;
}
Aggregations