Search in sources :

Example 1 with SubtransExecutor

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

the class BaseStreamStep method init.

@Override
public boolean init(StepMetaInterface stepMetaInterface, StepDataInterface stepDataInterface) {
    Preconditions.checkNotNull(stepMetaInterface);
    variablizedStepMeta = (BaseStreamStepMeta) stepMetaInterface;
    variablizedStepMeta.setParentStepMeta(getStepMeta());
    variablizedStepMeta.setFileName(variablizedStepMeta.getTransformationPath());
    boolean superInit = super.init(stepMetaInterface, stepDataInterface);
    try {
        TransMeta transMeta = TransExecutorMeta.loadMappingMeta(variablizedStepMeta, getTransMeta().getRepository(), getTransMeta().getMetaStore(), getParentVariableSpace());
        variablizedStepMeta = (BaseStreamStepMeta) variablizedStepMeta.withVariables(this);
        subtransExecutor = new SubtransExecutor(getStepname(), getTrans(), transMeta, true, new TransExecutorParameters(), variablizedStepMeta.getSubStep(), getPrefetchCount());
    } catch (KettleException e) {
        log.logError(e.getLocalizedMessage(), e);
        return false;
    }
    List<CheckResultInterface> remarks = new ArrayList<>();
    variablizedStepMeta.check(remarks, getTransMeta(), variablizedStepMeta.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;
}
Also used : Result(org.pentaho.di.core.Result) Trans(org.pentaho.di.trans.Trans) StepDataInterface(org.pentaho.di.trans.step.StepDataInterface) CheckResultInterface(org.pentaho.di.core.CheckResultInterface) StreamWindow(org.pentaho.di.trans.streaming.api.StreamWindow) KettleException(org.pentaho.di.core.exception.KettleException) TransExecutorMeta(org.pentaho.di.trans.steps.transexecutor.TransExecutorMeta) ArrayList(java.util.ArrayList) TransMeta(org.pentaho.di.trans.TransMeta) StepStatus(org.pentaho.di.trans.step.StepStatus) BaseMessages(org.pentaho.di.i18n.BaseMessages) StepMeta(org.pentaho.di.trans.step.StepMeta) StepMetaInterface(org.pentaho.di.trans.step.StepMetaInterface) Collection(java.util.Collection) Throwables(com.google.common.base.Throwables) StreamSource(org.pentaho.di.trans.streaming.api.StreamSource) BaseStep(org.pentaho.di.trans.step.BaseStep) RowMetaAndData(org.pentaho.di.core.RowMetaAndData) List(java.util.List) SubtransExecutor(org.pentaho.di.trans.SubtransExecutor) KettleStepException(org.pentaho.di.core.exception.KettleStepException) Preconditions(com.google.common.base.Preconditions) VisibleForTesting(com.google.common.annotations.VisibleForTesting) TransExecutorParameters(org.pentaho.di.trans.steps.transexecutor.TransExecutorParameters) Collections(java.util.Collections) KettleException(org.pentaho.di.core.exception.KettleException) SubtransExecutor(org.pentaho.di.trans.SubtransExecutor) TransMeta(org.pentaho.di.trans.TransMeta) ArrayList(java.util.ArrayList) TransExecutorParameters(org.pentaho.di.trans.steps.transexecutor.TransExecutorParameters) CheckResultInterface(org.pentaho.di.core.CheckResultInterface)

Aggregations

VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 Preconditions (com.google.common.base.Preconditions)1 Throwables (com.google.common.base.Throwables)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 List (java.util.List)1 CheckResultInterface (org.pentaho.di.core.CheckResultInterface)1 Result (org.pentaho.di.core.Result)1 RowMetaAndData (org.pentaho.di.core.RowMetaAndData)1 KettleException (org.pentaho.di.core.exception.KettleException)1 KettleStepException (org.pentaho.di.core.exception.KettleStepException)1 BaseMessages (org.pentaho.di.i18n.BaseMessages)1 SubtransExecutor (org.pentaho.di.trans.SubtransExecutor)1 Trans (org.pentaho.di.trans.Trans)1 TransMeta (org.pentaho.di.trans.TransMeta)1 BaseStep (org.pentaho.di.trans.step.BaseStep)1 StepDataInterface (org.pentaho.di.trans.step.StepDataInterface)1 StepMeta (org.pentaho.di.trans.step.StepMeta)1 StepMetaInterface (org.pentaho.di.trans.step.StepMetaInterface)1