Search in sources :

Example 1 with RunConfigurationProvider

use of org.pentaho.di.engine.configuration.api.RunConfigurationProvider in project pentaho-kettle by pentaho.

the class EmbeddedRunConfigurationManager method build.

public static RunConfigurationManager build(EmbeddedMetaStore embeddedMetaStore) {
    DefaultRunConfigurationProvider defaultRunConfigurationProvider = new DefaultRunConfigurationProvider(createMetastoreLocator(embeddedMetaStore), null);
    SparkRunConfigurationProvider sparkRunConfigurationProvider = new SparkRunConfigurationProvider(createMetastoreLocator(embeddedMetaStore), null);
    List<RunConfigurationProvider> runConfigurationProviders = new ArrayList<>();
    runConfigurationProviders.add(defaultRunConfigurationProvider);
    runConfigurationProviders.add(sparkRunConfigurationProvider);
    return new RunConfigurationManager(runConfigurationProviders);
}
Also used : DefaultRunConfigurationProvider(org.pentaho.di.engine.configuration.impl.pentaho.DefaultRunConfigurationProvider) SparkRunConfigurationProvider(org.pentaho.di.engine.configuration.impl.spark.SparkRunConfigurationProvider) ArrayList(java.util.ArrayList) RunConfigurationProvider(org.pentaho.di.engine.configuration.api.RunConfigurationProvider) DefaultRunConfigurationProvider(org.pentaho.di.engine.configuration.impl.pentaho.DefaultRunConfigurationProvider) SparkRunConfigurationProvider(org.pentaho.di.engine.configuration.impl.spark.SparkRunConfigurationProvider)

Example 2 with RunConfigurationProvider

use of org.pentaho.di.engine.configuration.api.RunConfigurationProvider in project pentaho-kettle by pentaho.

the class RunConfigurationManager method getNames.

public List<String> getNames() {
    List<String> names = new ArrayList<>();
    for (RunConfigurationProvider runConfigurationProvider : getRunConfigurationProviders()) {
        names.addAll(runConfigurationProvider.getNames());
    }
    Collections.sort(names, (o1, o2) -> {
        if (o2.equals(DefaultRunConfigurationProvider.DEFAULT_CONFIG_NAME)) {
            return 1;
        }
        return o1.compareToIgnoreCase(o2);
    });
    return names;
}
Also used : ArrayList(java.util.ArrayList) RunConfigurationProvider(org.pentaho.di.engine.configuration.api.RunConfigurationProvider) DefaultRunConfigurationProvider(org.pentaho.di.engine.configuration.impl.pentaho.DefaultRunConfigurationProvider)

Example 3 with RunConfigurationProvider

use of org.pentaho.di.engine.configuration.api.RunConfigurationProvider in project pentaho-kettle by pentaho.

the class RunConfigurationManager method getNames.

public List<String> getNames(String type) {
    List<String> names = new ArrayList<>();
    for (RunConfigurationProvider runConfigurationProvider : getRunConfigurationProviders(type)) {
        names.addAll(runConfigurationProvider.getNames());
    }
    Collections.sort(names, (o1, o2) -> {
        if (o2.equals(DefaultRunConfigurationProvider.DEFAULT_CONFIG_NAME)) {
            return 1;
        }
        return o1.compareToIgnoreCase(o2);
    });
    return names;
}
Also used : ArrayList(java.util.ArrayList) RunConfigurationProvider(org.pentaho.di.engine.configuration.api.RunConfigurationProvider) DefaultRunConfigurationProvider(org.pentaho.di.engine.configuration.impl.pentaho.DefaultRunConfigurationProvider)

Example 4 with RunConfigurationProvider

use of org.pentaho.di.engine.configuration.api.RunConfigurationProvider in project pentaho-kettle by pentaho.

the class RunConfigurationManager method load.

@Override
public List<RunConfiguration> load() {
    List<RunConfiguration> runConfigurations = new ArrayList<>();
    for (RunConfigurationProvider runConfigurationProvider : getRunConfigurationProviders()) {
        runConfigurations.addAll(runConfigurationProvider.load());
    }
    Collections.sort(runConfigurations, (o1, o2) -> {
        if (o2.getName().equals(DefaultRunConfigurationProvider.DEFAULT_CONFIG_NAME)) {
            return 1;
        }
        return o1.getName().compareToIgnoreCase(o2.getName());
    });
    return runConfigurations;
}
Also used : RunConfiguration(org.pentaho.di.engine.configuration.api.RunConfiguration) ArrayList(java.util.ArrayList) RunConfigurationProvider(org.pentaho.di.engine.configuration.api.RunConfigurationProvider) DefaultRunConfigurationProvider(org.pentaho.di.engine.configuration.impl.pentaho.DefaultRunConfigurationProvider)

Example 5 with RunConfigurationProvider

use of org.pentaho.di.engine.configuration.api.RunConfigurationProvider in project pentaho-kettle by pentaho.

the class RunConfigurationManagerTest method setup.

@Before
public void setup() throws Exception {
    MemoryMetaStore memoryMetaStore = new MemoryMetaStore();
    MetastoreLocator metastoreLocator = createMetastoreLocator(memoryMetaStore);
    DefaultRunConfigurationProvider defaultRunConfigurationProvider = new DefaultRunConfigurationProvider(metastoreLocator, defaultRunConfigurationExecutor);
    SparkRunConfigurationExecutor sparkRunConfigurationExecutor = new SparkRunConfigurationExecutor(null);
    SparkRunConfigurationProvider sparkRunConfigurationProvider = new SparkRunConfigurationProvider(metastoreLocator, sparkRunConfigurationExecutor);
    List<RunConfigurationProvider> runConfigurationProviders = new ArrayList<>();
    runConfigurationProviders.add(sparkRunConfigurationProvider);
    executionConfigurationManager = new RunConfigurationManager(runConfigurationProviders);
    executionConfigurationManager.setDefaultRunConfigurationProvider(defaultRunConfigurationProvider);
    DefaultRunConfiguration defaultRunConfiguration = new DefaultRunConfiguration();
    defaultRunConfiguration.setName("Default Configuration");
    defaultRunConfiguration.setDescription("Default Configuration Description");
    defaultRunConfiguration.setLocal(true);
    executionConfigurationManager.save(defaultRunConfiguration);
    SparkRunConfiguration sparkRunConfiguration = new SparkRunConfiguration();
    sparkRunConfiguration.setName("Spark Configuration");
    sparkRunConfiguration.setDescription("Spark Configuration Description");
    sparkRunConfiguration.setUrl("127.0.0.1");
    executionConfigurationManager.save(sparkRunConfiguration);
}
Also used : MemoryMetaStore(org.pentaho.metastore.stores.memory.MemoryMetaStore) DefaultRunConfigurationProvider(org.pentaho.di.engine.configuration.impl.pentaho.DefaultRunConfigurationProvider) SparkRunConfigurationProvider(org.pentaho.di.engine.configuration.impl.spark.SparkRunConfigurationProvider) SparkRunConfiguration(org.pentaho.di.engine.configuration.impl.spark.SparkRunConfiguration) SparkRunConfigurationExecutor(org.pentaho.di.engine.configuration.impl.spark.SparkRunConfigurationExecutor) ArrayList(java.util.ArrayList) DefaultRunConfiguration(org.pentaho.di.engine.configuration.impl.pentaho.DefaultRunConfiguration) MetastoreLocator(org.pentaho.osgi.metastore.locator.api.MetastoreLocator) SparkRunConfigurationProvider(org.pentaho.di.engine.configuration.impl.spark.SparkRunConfigurationProvider) RunConfigurationProvider(org.pentaho.di.engine.configuration.api.RunConfigurationProvider) DefaultRunConfigurationProvider(org.pentaho.di.engine.configuration.impl.pentaho.DefaultRunConfigurationProvider) Before(org.junit.Before)

Aggregations

ArrayList (java.util.ArrayList)6 RunConfigurationProvider (org.pentaho.di.engine.configuration.api.RunConfigurationProvider)6 DefaultRunConfigurationProvider (org.pentaho.di.engine.configuration.impl.pentaho.DefaultRunConfigurationProvider)6 SparkRunConfigurationProvider (org.pentaho.di.engine.configuration.impl.spark.SparkRunConfigurationProvider)3 RunConfiguration (org.pentaho.di.engine.configuration.api.RunConfiguration)2 DefaultRunConfiguration (org.pentaho.di.engine.configuration.impl.pentaho.DefaultRunConfiguration)2 SparkRunConfiguration (org.pentaho.di.engine.configuration.impl.spark.SparkRunConfiguration)2 SparkRunConfigurationExecutor (org.pentaho.di.engine.configuration.impl.spark.SparkRunConfigurationExecutor)2 MemoryMetaStore (org.pentaho.metastore.stores.memory.MemoryMetaStore)2 MetastoreLocator (org.pentaho.osgi.metastore.locator.api.MetastoreLocator)2 Before (org.junit.Before)1 Test (org.junit.Test)1