use of org.pentaho.di.engine.configuration.impl.pentaho.DefaultRunConfigurationProvider 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);
}
use of org.pentaho.di.engine.configuration.impl.pentaho.DefaultRunConfigurationProvider 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);
}
use of org.pentaho.di.engine.configuration.impl.pentaho.DefaultRunConfigurationProvider in project pentaho-kettle by pentaho.
the class RunConfigurationManagerTest method testOrdering.
@Test
public void testOrdering() {
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 defaultRunConfiguration1 = new DefaultRunConfiguration();
defaultRunConfiguration1.setName("z");
executionConfigurationManager.save(defaultRunConfiguration1);
DefaultRunConfiguration defaultRunConfiguration2 = new DefaultRunConfiguration();
defaultRunConfiguration2.setName("f");
executionConfigurationManager.save(defaultRunConfiguration2);
DefaultRunConfiguration defaultRunConfiguration3 = new DefaultRunConfiguration();
defaultRunConfiguration3.setName("x");
executionConfigurationManager.save(defaultRunConfiguration3);
SparkRunConfiguration sparkRunConfiguration = new SparkRunConfiguration();
sparkRunConfiguration.setName("d");
executionConfigurationManager.save(sparkRunConfiguration);
DefaultRunConfiguration defaultRunConfiguration5 = new DefaultRunConfiguration();
defaultRunConfiguration5.setName("a");
executionConfigurationManager.save(defaultRunConfiguration5);
List<RunConfiguration> runConfigurations = executionConfigurationManager.load();
assertEquals(runConfigurations.get(0).getName(), DefaultRunConfigurationProvider.DEFAULT_CONFIG_NAME);
assertEquals(runConfigurations.get(1).getName(), "a");
assertEquals(runConfigurations.get(2).getName(), "d");
assertEquals(runConfigurations.get(3).getName(), "f");
assertEquals(runConfigurations.get(4).getName(), "x");
assertEquals(runConfigurations.get(5).getName(), "z");
List<String> names = executionConfigurationManager.getNames();
assertEquals(names.get(0), DefaultRunConfigurationProvider.DEFAULT_CONFIG_NAME);
assertEquals(names.get(1), "a");
assertEquals(names.get(2), "d");
assertEquals(names.get(3), "f");
assertEquals(names.get(4), "x");
assertEquals(names.get(5), "z");
}
Aggregations