public String[] getInfoSteps() { if ( acceptingFilenames && acceptingStep != null ) { return new String[] { acceptingStep.getName() }; } return null; }
public String toString() { if ( stepMeta == null ) { return "Stream type " + streamType + Const.CR + description; } else { return "Stream type " + streamType + " for step '" + stepMeta.getName() + "'" + Const.CR + description; } }
public String getStepname() { if ( stepMeta == null ) { return null; } return stepMeta.getName(); }
public String[] getInfoSteps() { if ( acceptingFilenames && acceptingStep != null ) { return new String[] { acceptingStep.getName() }; } return null; }
private static Set<String> getUsedStepsForReferencendTransformation( TransMeta transMeta ) { Set<String> usedStepNames = new HashSet<String>(); for ( StepMeta currentStep : transMeta.getUsedSteps() ) { usedStepNames.add( currentStep.getName().toUpperCase() ); } return usedStepNames; }
/** * Finds the last active transformation in the running job to the opened transMeta * * @param transGraph * @param stepMeta */ private Trans getActiveSubtransformation( TransGraph transGraph, StepMeta stepMeta ) { if ( trans != null && transGraph != null ) { return trans.getActiveSubTransformation( stepMeta.getName() ); } return null; }
private static Operation getOp( org.pentaho.di.engine.model.Transformation transformation, StepMeta step ) throws KettleException { return transformation.getOperations().stream() .filter( op -> step.getName().equals( op.getId() ) ) .findFirst() .orElseThrow( () -> new KettleException( "Could not find operation: " + step.getName() ) ); }
public MQTTClientBuilder withStep( StepInterface step ) { this.logChannel = step.getLogChannel(); this.stepName = step.getStepMeta().getName(); return this; }
private static StepMeta mockStepMeta( String name ) { StepMeta meta = mock( StepMeta.class ); when( meta.getName() ).thenReturn( name ); return meta; }
private StepMeta createStepMeta( String name ) { StepMeta stepMeta = mock( StepMeta.class ); when( stepMeta.getName() ).thenReturn( name ); return stepMeta; }
private static Consumer<StepMeta> createOperation( org.pentaho.di.engine.model.Transformation transformation ) { return stepMeta -> { org.pentaho.di.engine.model.Operation operation = transformation.createOperation( stepMeta.getName() ); try { operation.setConfig( STEP_META_CONF_KEY, stepMeta.getXML() ); } catch ( KettleException e ) { Throwables.propagate( e ); } }; }
/** * Copy information from the meta-data input to the dialog fields. */ public void getData() { if ( input.getFromStep() != null ) { wFrom.setText( input.getFromStep().getName() ); } if ( input.getToStep() != null ) { wTo.setText( input.getToStep().getName() ); } wEnabled.setSelection( input.isEnabled() ); }
public void analyseImpact( List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta, RowMeta prev, String[] input, String[] output, RowMeta info ) throws KettleStepException { DatabaseImpact ii = new DatabaseImpact( DatabaseImpact.TYPE_IMPACT_READ_WRITE, transMeta.getName(), stepMeta.getName(), databaseMeta.getDatabaseName(), BaseMessages.getString( PKG, "ExecSQLMeta.DatabaseMeta.Unknown.Label" ), BaseMessages.getString( PKG, "ExecSQLMeta.DatabaseMeta.Unknown2.Label" ), BaseMessages.getString( PKG, "ExecSQLMeta.DatabaseMeta.Unknown3.Label" ), stepMeta.getName(), sql, BaseMessages.getString( PKG, "ExecSQLMeta.DatabaseMeta.Title" ) ); impact.add( ii ); }
@Test public void testCleanAfterHopToRemove_NullParameter() { JoinRowsMeta joinRowsMeta = new JoinRowsMeta(); StepMeta stepMeta1 = new StepMeta( "Step1", mock( StepMetaInterface.class ) ); joinRowsMeta.setMainStep( stepMeta1 ); joinRowsMeta.setMainStepname( stepMeta1.getName() ); // This call must not throw an exception joinRowsMeta.cleanAfterHopToRemove( null ); // And no change to the step should be made assertEquals( stepMeta1, joinRowsMeta.getMainStep() ); assertEquals( stepMeta1.getName(), joinRowsMeta.getMainStepname() ); }
@Test public void testCleanAfterHopToRemove_ReferredStep() { JoinRowsMeta joinRowsMeta = new JoinRowsMeta(); StepMeta stepMeta1 = new StepMeta( "Step1", mock( StepMetaInterface.class ) ); joinRowsMeta.setMainStep( stepMeta1 ); joinRowsMeta.setMainStepname( stepMeta1.getName() ); joinRowsMeta.cleanAfterHopToRemove( stepMeta1 ); // No change to the step should be made assertNull( joinRowsMeta.getMainStep() ); assertNull( joinRowsMeta.getMainStepname() ); } }