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);
}
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;
}
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;
}
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;
}
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);
}
Aggregations