public boolean init() throws KettleException { // See if the steps support the SingleThreaded transformation type... // for ( StepMetaDataCombi combi : steps ) { TransformationType[] types = combi.stepMeta.getStepMetaInterface().getSupportedTransformationTypes(); boolean ok = false; for ( TransformationType type : types ) { if ( type == TransformationType.SingleThreaded ) { ok = true; } } if ( !ok ) { throw new KettleException( "Step '" + combi.stepname + "' of type '" + combi.stepMeta.getStepID() + "' is not yet supported in a Single Threaded transformation engine." ); } } // Initialize all the steps... // for ( StepMetaDataCombi combi : steps ) { boolean ok = combi.step.init( combi.meta, combi.data ); if ( !ok ) { return false; } } return true; }
public void run() { // Set the internal variables also on the initialization thread! // ((BaseStep)combi.step).setInternalVariables(); if ( !doIt ) { // An extension point plugin decided we should not initialize the step. // Logging, error handling, finished flag... should all be handled in the extension point. // return; } try { combi.step.getLogChannel().snap( Metrics.METRIC_STEP_INIT_START ); if ( combi.step.init( combi.meta, combi.data ) ) { combi.data.setStatus( StepExecutionStatus.STATUS_IDLE ); ok = true; } else { combi.step.setErrors( 1 ); log.logError( BaseMessages.getString( PKG, "Trans.Log.ErrorInitializingStep", combi.step.getStepname() ) ); } } catch ( Throwable e ) { log.logError( BaseMessages.getString( PKG, "Trans.Log.ErrorInitializingStep", combi.step.getStepname() ) ); log.logError( Const.getStackTracker( e ) ); } finally { combi.step.getLogChannel().snap( Metrics.METRIC_STEP_INIT_STOP ); } finished = true; }