Search in sources :

Example 1 with ExecutionConfiguration

use of org.pentaho.di.ExecutionConfiguration in project pentaho-kettle by pentaho.

the class RunConfigurationRunExtensionPoint method callExtensionPoint.

@Override
public void callExtensionPoint(LogChannelInterface logChannelInterface, Object o) throws KettleException {
    ExecutionConfiguration executionConfiguration = (ExecutionConfiguration) ((Object[]) o)[0];
    AbstractMeta meta = (AbstractMeta) ((Object[]) o)[1];
    VariableSpace variableSpace = (VariableSpace) ((Object[]) o)[2];
    Repository repository = (Repository) ((Object[]) o)[3];
    EmbeddedMetaStore embeddedMetaStore = meta.getEmbeddedMetaStore();
    RunConfiguration runConfiguration = runConfigurationManager.load(executionConfiguration.getRunConfiguration());
    if (runConfiguration == null) {
        RunConfigurationManager embeddedRunConfigurationManager = EmbeddedRunConfigurationManager.build(embeddedMetaStore);
        runConfiguration = embeddedRunConfigurationManager.load(executionConfiguration.getRunConfiguration());
    }
    if (runConfiguration != null) {
        RunConfigurationExecutor runConfigurationExecutor = runConfigurationManager.getExecutor(runConfiguration.getType());
        if (runConfigurationExecutor != null) {
            runConfigurationExecutor.execute(runConfiguration, executionConfiguration, meta, variableSpace, repository);
        }
    } else {
        String name = "";
        if (variableSpace instanceof TransMeta) {
            name = ((TransMeta) variableSpace).getFilename();
        }
        throw new KettleException(BaseMessages.getString(PKG, "RunConfigurationRunExtensionPoint.ConfigNotFound.Error", name, executionConfiguration.getRunConfiguration(), "{0}"));
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) Repository(org.pentaho.di.repository.Repository) RunConfiguration(org.pentaho.di.engine.configuration.api.RunConfiguration) VariableSpace(org.pentaho.di.core.variables.VariableSpace) RunConfigurationManager(org.pentaho.di.engine.configuration.impl.RunConfigurationManager) EmbeddedRunConfigurationManager(org.pentaho.di.engine.configuration.impl.EmbeddedRunConfigurationManager) AbstractMeta(org.pentaho.di.base.AbstractMeta) TransMeta(org.pentaho.di.trans.TransMeta) ExecutionConfiguration(org.pentaho.di.ExecutionConfiguration) RunConfigurationExecutor(org.pentaho.di.engine.configuration.api.RunConfigurationExecutor) EmbeddedMetaStore(org.pentaho.di.core.attributes.metastore.EmbeddedMetaStore)

Aggregations

ExecutionConfiguration (org.pentaho.di.ExecutionConfiguration)1 AbstractMeta (org.pentaho.di.base.AbstractMeta)1 EmbeddedMetaStore (org.pentaho.di.core.attributes.metastore.EmbeddedMetaStore)1 KettleException (org.pentaho.di.core.exception.KettleException)1 VariableSpace (org.pentaho.di.core.variables.VariableSpace)1 RunConfiguration (org.pentaho.di.engine.configuration.api.RunConfiguration)1 RunConfigurationExecutor (org.pentaho.di.engine.configuration.api.RunConfigurationExecutor)1 EmbeddedRunConfigurationManager (org.pentaho.di.engine.configuration.impl.EmbeddedRunConfigurationManager)1 RunConfigurationManager (org.pentaho.di.engine.configuration.impl.RunConfigurationManager)1 Repository (org.pentaho.di.repository.Repository)1 TransMeta (org.pentaho.di.trans.TransMeta)1