use of org.pentaho.di.core.Result in project pentaho-kettle by pentaho.
the class MasterSlaveIT method runSubtransformationClustered.
/**
* This test check passing rows to sub-transformation executed on cluster
* See PDI-10704 for details
* @throws Exception
*/
public void runSubtransformationClustered() throws Exception {
TransMeta transMeta = loadTransMetaReplaceSlavesInCluster(clusterGenerator, "test/org/pentaho/di/cluster/test-subtrans-clustered.ktr");
TransExecutionConfiguration config = createClusteredTransExecutionConfiguration();
Result prevResult = new Result();
prevResult.setRows(getSampleRows());
config.setPreviousResult(prevResult);
TransSplitter transSplitter = Trans.executeClustered(transMeta, config);
LogChannel logChannel = createLogChannel("cluster unit test <runSubtransformationClustered>");
long nrErrors = Trans.monitorClusteredTransformation(logChannel, transSplitter, null, 1);
assertEquals(0L, nrErrors);
String result = loadFileContent(transMeta, "${java.io.tmpdir}/test-subtrans-clustered.txt");
assertEqualsIgnoreWhitespacesAndCase("10", result);
}
use of org.pentaho.di.core.Result in project pentaho-kettle by pentaho.
the class RunMappingIT method test_MAPPING_INPUT_ONLY.
public void test_MAPPING_INPUT_ONLY() throws Exception {
KettleEnvironment.init();
TimedTransRunner timedTransRunner = new TimedTransRunner("test/org/pentaho/di/trans/steps/mapping/filereader/use filereader.ktr", LogLevel.ERROR, getTargetDatabase(), 1000);
assertTrue(timedTransRunner.runEngine(true));
Result newResult = timedTransRunner.getNewResult();
assertTrue(newResult.getNrErrors() == 0);
}
use of org.pentaho.di.core.Result in project pentaho-kettle by pentaho.
the class SlaveServerTransStatus method getResult.
public Result getResult(TransMeta transMeta) {
Result result = new Result();
for (StepStatus stepStatus : stepStatusList) {
// If the
result.setNrErrors(result.getNrErrors() + stepStatus.getErrors() + (result.isStopped() ? 1 : 0));
if (stepStatus.getStepname().equals(transMeta.getTransLogTable().getStepnameRead())) {
result.increaseLinesRead(stepStatus.getLinesRead());
}
if (stepStatus.getStepname().equals(transMeta.getTransLogTable().getStepnameInput())) {
result.increaseLinesInput(stepStatus.getLinesInput());
}
if (stepStatus.getStepname().equals(transMeta.getTransLogTable().getStepnameWritten())) {
result.increaseLinesWritten(stepStatus.getLinesWritten());
}
if (stepStatus.getStepname().equals(transMeta.getTransLogTable().getStepnameOutput())) {
result.increaseLinesOutput(stepStatus.getLinesOutput());
}
if (stepStatus.getStepname().equals(transMeta.getTransLogTable().getStepnameUpdated())) {
result.increaseLinesUpdated(stepStatus.getLinesUpdated());
}
if (stepStatus.getStepname().equals(transMeta.getTransLogTable().getStepnameRejected())) {
result.increaseLinesRejected(stepStatus.getLinesRejected());
}
if (stepStatus.isStopped()) {
result.setStopped(true);
result.setResult(false);
}
}
return result;
}
use of org.pentaho.di.core.Result in project pentaho-kettle by pentaho.
the class ExecSQLMeta method getFields.
public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
RowMetaAndData add = ExecSQL.getResultRow(new Result(), getUpdateField(), getInsertField(), getDeleteField(), getReadField());
r.mergeRowMeta(add.getRowMeta());
}
use of org.pentaho.di.core.Result in project pentaho-kettle by pentaho.
the class BaseStreamStep method init.
public boolean init(StepMetaInterface stepMetaInterface, StepDataInterface stepDataInterface) {
Preconditions.checkNotNull(stepMetaInterface);
stepMeta = (BaseStreamStepMeta) stepMetaInterface;
stepMeta.setParentStepMeta(getStepMeta());
stepMeta.setFileName(stepMeta.getTransformationPath());
boolean superInit = super.init(stepMetaInterface, stepDataInterface);
try {
TransMeta transMeta = TransExecutorMeta.loadMappingMeta(stepMeta, getTransMeta().getRepository(), getTransMeta().getMetaStore(), getParentVariableSpace());
subtransExecutor = new SubtransExecutor(getStepname(), getTrans(), transMeta, true, new TransExecutorParameters(), environmentSubstitute(stepMeta.getSubStep()));
} catch (KettleException e) {
log.logError(e.getLocalizedMessage(), e);
return false;
}
List<CheckResultInterface> remarks = new ArrayList<>();
stepMeta.check(remarks, getTransMeta(), stepMeta.getParentStepMeta(), // these parameters are not used inside the method
null, // these parameters are not used inside the method
null, // these parameters are not used inside the method
null, // these parameters are not used inside the method
null, variables, getRepository(), getMetaStore());
boolean errorsPresent = remarks.stream().filter(result -> result.getType() == CheckResultInterface.TYPE_RESULT_ERROR).peek(result -> logError(result.getText())).count() > 0;
if (errorsPresent) {
return false;
}
return superInit;
}
Aggregations