use of org.talend.hadoop.distribution.dynamic.DynamicConfiguration in project tbd-studio-se by Talend.
the class DynamicDistributionOptionForm method initData.
private void initData(IDynamicMonitor monitor) {
try {
namePluginMap = getNamePluginMap();
getDynamicDistributionSetupData().setNamePluginMap(namePluginMap);
} catch (Exception e) {
ExceptionHandler.process(e);
}
DynamicDistributionSetupData dynConfigData = getDynamicDistributionSetupData();
IDynamicDistributionsGroup dynamicDistributionsGroup = dynConfigData.getDynamicDistributionsGroup();
dynamicConfiguration = new DynamicConfiguration();
dynamicConfiguration.setDistribution(dynamicDistributionsGroup.getDistribution());
try {
refreshExistingConfigsCombo(monitor, dynamicDistributionsGroup);
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
use of org.talend.hadoop.distribution.dynamic.DynamicConfiguration in project tbd-studio-se by Talend.
the class DynamicDistributionOptionForm method buildDynamicConfiguration.
private DynamicConfiguration buildDynamicConfiguration(IDynamicPlugin plugin) {
if (plugin == null) {
return null;
}
IDynamicPluginConfiguration pluginConfiguration = plugin.getPluginConfiguration();
DynamicConfiguration config = new DynamicConfiguration();
config.setDescription(pluginConfiguration.getDescription());
config.setDistribution(pluginConfiguration.getDistribution());
config.setId(pluginConfiguration.getId());
config.setName(pluginConfiguration.getName());
config.setVersion(pluginConfiguration.getVersion());
return config;
}
use of org.talend.hadoop.distribution.dynamic.DynamicConfiguration in project tbd-studio-se by Talend.
the class AbstractDependencyResolverTest method testGetDependencyVersionByHadoopVersionHortonworks.
@Test
public void testGetDependencyVersionByHadoopVersionHortonworks() throws Exception {
DynamicDistributionManager dynamicDistributionManager = DynamicDistributionManager.getInstance();
DynamicConfiguration configuration = new DynamicConfiguration();
// $NON-NLS-1$
configuration.setDistribution("HORTONWORKS");
// $NON-NLS-1$ //$NON-NLS-2$
List<String> hadoopVersions = Arrays.asList("3.1.4.12-1");
for (String hadoopVersion : hadoopVersions) {
configuration.setVersion(hadoopVersion);
IDependencyResolver dependencyResolver = dynamicDistributionManager.getDependencyResolver(configuration);
String sparkYarnVersion = // $NON-NLS-1$
dependencyResolver.getDependencyVersionByHadoopVersion(// $NON-NLS-1$
"org.apache.spark", // $NON-NLS-1$
"spark-yarn_2.11", null);
Assert.assertNotNull(sparkYarnVersion);
// $NON-NLS-1$ //$NON-NLS-2$
String hiveJdbcVersion = dependencyResolver.getDependencyVersionByHadoopVersion("org.apache.hive", "hive-jdbc", null);
Assert.assertNotNull(hiveJdbcVersion);
}
}
use of org.talend.hadoop.distribution.dynamic.DynamicConfiguration in project tbd-studio-se by Talend.
the class AbstractDependencyResolverTest method testGetDependencyVersionByHadoopVersionCdp.
@Test
public void testGetDependencyVersionByHadoopVersionCdp() throws Exception {
DynamicDistributionManager dynamicDistributionManager = DynamicDistributionManager.getInstance();
DynamicConfiguration configuration = new DynamicConfiguration();
// $NON-NLS-1$
configuration.setDistribution("CDP");
// $NON-NLS-1$
List<String> hadoopVersions = Arrays.asList("7.1.0.2-7");
for (String hadoopVersion : hadoopVersions) {
configuration.setVersion(hadoopVersion);
IDependencyResolver dependencyResolver = dynamicDistributionManager.getDependencyResolver(configuration);
String sparkYarnVersion = // $NON-NLS-1$
dependencyResolver.getDependencyVersionByHadoopVersion(// $NON-NLS-1$
"org.apache.spark", // $NON-NLS-1$
"spark-yarn_2.11", null);
Assert.assertNotNull(sparkYarnVersion);
}
}
use of org.talend.hadoop.distribution.dynamic.DynamicConfiguration in project tbd-studio-se by Talend.
the class DynamicModuleAdapterTest method testAdapt.
@Test
public void testAdapt() throws Exception {
TemplateBean templateBean = new TemplateBean();
// $NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
ModuleBean moduleBean = new ModuleBean(ModuleBean.TYPE_BASE, "org.apache.hive", "hive-jdbc", "2.1.0.2.6.5.5000-33");
DynamicDistributionManager dynamicDistributionManager = DynamicDistributionManager.getInstance();
DynamicConfiguration configuration = new DynamicConfiguration();
// $NON-NLS-1$
configuration.setDistribution("HORTONWORKS");
// $NON-NLS-1$
configuration.setVersion("2.6.5.5000-33");
IDependencyResolver dependencyResolver = dynamicDistributionManager.getDependencyResolver(configuration);
Set<String> registeredModules = new HashSet<String>();
DynamicModuleAdapter dynamicModuleAdapter = new DynamicModuleAdapter(templateBean, configuration, moduleBean, dependencyResolver, registeredModules);
List<IDynamicConfiguration> librariesNeeded = dynamicModuleAdapter.adapt(null, false);
librariesNeeded.stream().forEach(l -> System.out.println(l.toString()));
Assert.assertTrue(librariesNeeded.size() > 1);
}
Aggregations