public void applyVariableToAllLoadedObjects( String name, String value ) { // We want to insert the variables into all loaded jobs and // transformations // for ( TransMeta transMeta : getLoadedTransformations() ) { transMeta.setVariable( name, Const.NVL( value, "" ) ); } for ( JobMeta jobMeta : getLoadedJobs() ) { jobMeta.setVariable( name, Const.NVL( value, "" ) ); } // Not only that, we also want to set the variables in the // execution configurations... // transExecutionConfiguration.getVariables().put( name, value ); jobExecutionConfiguration.getVariables().put( name, value ); transDebugExecutionConfiguration.getVariables().put( name, value ); }
/** * Execute the transformation in a clustered fashion. The transformation steps are split and collected in a * TransSplitter object * * @param transMeta the transformation's meta-data * @param executionConfiguration the execution configuration * @return the transformation splitter object * @throws KettleException the kettle exception */ public static TransSplitter executeClustered( final TransMeta transMeta, final TransExecutionConfiguration executionConfiguration ) throws KettleException { if ( Utils.isEmpty( transMeta.getName() ) ) { throw new KettleException( "The transformation needs a name to uniquely identify it by on the remote server." ); } TransSplitter transSplitter = new TransSplitter( transMeta ); transSplitter.splitOriginalTransformation(); // Pass the clustered run ID to allow for parallel execution of clustered transformations // executionConfiguration.getVariables().put( Const.INTERNAL_VARIABLE_CLUSTER_RUN_ID, transSplitter .getClusteredRunId() ); executeClustered( transSplitter, executionConfiguration ); return transSplitter; }
new TransConfiguration( slaveTrans, slaveTransExecutionConfiguration ); Map<String, String> variables = slaveTransExecutionConfiguration.getVariables(); variables.put( Const.INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER, Integer.toString( index ) ); variables.put( Const.INTERNAL_VARIABLE_SLAVE_SERVER_NAME, slaves[ index ].getName() );
trans.setSafeModeEnabled( executionConfiguration.isSafeModeEnabled() ); trans.setGatheringMetrics( executionConfiguration.isGatheringMetrics() ); trans.injectVariables( executionConfiguration.getVariables() ); trans.setPreviousResult( executionConfiguration.getPreviousResult() );
executionConfiguration.getVariables().put( var, transMeta.getVariable( var ) ); executionConfiguration.getVariables().put( var, transMeta.getVariable( var ) ); param ) ) ); if ( !Utils.isEmpty( value ) ) { executionConfiguration.getVariables().put( param, value );
@GET @Path( "/prepare/{id : .+}" ) @Produces( { MediaType.APPLICATION_JSON } ) public TransformationStatus prepareTransformation( @PathParam( "id" ) String id ) { Trans trans = CarteResource.getTransformation( id ); try { CarteObjectEntry entry = CarteResource.getCarteObjectEntry( id ); TransConfiguration transConfiguration = CarteSingleton.getInstance().getTransformationMap().getConfiguration( entry ); TransExecutionConfiguration executionConfiguration = transConfiguration.getTransExecutionConfiguration(); // Set the appropriate logging, variables, arguments, replay date, ... // etc. trans.setArguments( executionConfiguration.getArgumentStrings() ); trans.setReplayDate( executionConfiguration.getReplayDate() ); trans.setSafeModeEnabled( executionConfiguration.isSafeModeEnabled() ); trans.setGatheringMetrics( executionConfiguration.isGatheringMetrics() ); trans.injectVariables( executionConfiguration.getVariables() ); trans.setPreviousResult( executionConfiguration.getPreviousResult() ); trans.prepareExecution( null ); } catch ( KettleException e ) { e.printStackTrace(); } return getTransformationStatus( id ); }
trans.setSafeModeEnabled( executionConfiguration.isSafeModeEnabled() ); trans.setGatheringMetrics( executionConfiguration.isGatheringMetrics() ); trans.injectVariables( executionConfiguration.getVariables() ); trans.setPreviousResult( executionConfiguration.getPreviousResult() );
logDetailed( "Logging level set to " + log.getLogLevel().getDescription() ); transMeta.injectVariables( transExecutionConfiguration.getVariables() );
if ( executionConfiguration.isClusterPosting() ) { TransConfiguration transConfiguration = new TransConfiguration( master, executionConfiguration ); Map<String, String> variables = transConfiguration.getTransExecutionConfiguration().getVariables(); variables.put( Const.INTERNAL_VARIABLE_CLUSTER_SIZE, Integer.toString( slaves.length ) ); variables.put( Const.INTERNAL_VARIABLE_CLUSTER_MASTER, "Y" );
log.logDetailed( "Logging level set to " + log.getLogLevel().getDescription() ); transMeta.injectVariables( transExecutionConfiguration.getVariables() );
executionConfiguration.getVariables().putAll( vars ); slaveServer.injectVariables( executionConfiguration.getVariables() );
trans.injectVariables( transConfiguration.getTransExecutionConfiguration().getVariables() );
String[] fields = spoon.variables.getRowMeta().getFieldNames(); Map<String, String> variableMap = new HashMap<String, String>(); variableMap.putAll( executionConfiguration.getVariables() ); // the default for ( int idx = 0; idx < fields.length; idx++ ) { String value = executionConfiguration.getVariables().get( fields[idx] ); if ( Utils.isEmpty( value ) ) { value = data[idx].toString();
args = convertArguments( arguments ); transMeta.injectVariables( executionConfiguration.getVariables() );
transMeta.injectVariables( executionConfiguration.getVariables() );
TransExecutionConfiguration transExecutionConfiguration = transConfiguration.getTransExecutionConfiguration(); transMeta.setLogLevel( transExecutionConfiguration.getLogLevel() ); transMeta.injectVariables( transExecutionConfiguration.getVariables() );