Search in sources :

Example 11 with DynamicConfiguration

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);
    }
}
Also used : IDynamicDistributionsGroup(org.talend.hadoop.distribution.dynamic.IDynamicDistributionsGroup) DynamicConfiguration(org.talend.hadoop.distribution.dynamic.DynamicConfiguration) DynamicDistributionSetupData(org.talend.repository.hadoopcluster.ui.dynamic.DynamicDistributionSetupData) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Example 12 with DynamicConfiguration

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;
}
Also used : DynamicConfiguration(org.talend.hadoop.distribution.dynamic.DynamicConfiguration) IDynamicPluginConfiguration(org.talend.core.runtime.dynamic.IDynamicPluginConfiguration)

Example 13 with DynamicConfiguration

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);
    }
}
Also used : DynamicConfiguration(org.talend.hadoop.distribution.dynamic.DynamicConfiguration) DynamicDistributionManager(org.talend.hadoop.distribution.dynamic.DynamicDistributionManager) Test(org.junit.Test)

Example 14 with DynamicConfiguration

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);
    }
}
Also used : DynamicConfiguration(org.talend.hadoop.distribution.dynamic.DynamicConfiguration) DynamicDistributionManager(org.talend.hadoop.distribution.dynamic.DynamicDistributionManager) Test(org.junit.Test)

Example 15 with DynamicConfiguration

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);
}
Also used : IDynamicConfiguration(org.talend.core.runtime.dynamic.IDynamicConfiguration) IDynamicConfiguration(org.talend.core.runtime.dynamic.IDynamicConfiguration) DynamicConfiguration(org.talend.hadoop.distribution.dynamic.DynamicConfiguration) DynamicDistributionManager(org.talend.hadoop.distribution.dynamic.DynamicDistributionManager) ModuleBean(org.talend.hadoop.distribution.dynamic.bean.ModuleBean) TemplateBean(org.talend.hadoop.distribution.dynamic.bean.TemplateBean) IDependencyResolver(org.talend.hadoop.distribution.dynamic.resolver.IDependencyResolver) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

DynamicConfiguration (org.talend.hadoop.distribution.dynamic.DynamicConfiguration)15 TemplateBean (org.talend.hadoop.distribution.dynamic.bean.TemplateBean)7 IDynamicConfiguration (org.talend.core.runtime.dynamic.IDynamicConfiguration)6 DynamicDistributionManager (org.talend.hadoop.distribution.dynamic.DynamicDistributionManager)4 Test (org.junit.Test)3 IDynamicExtension (org.talend.core.runtime.dynamic.IDynamicExtension)3 IDynamicPluginConfiguration (org.talend.core.runtime.dynamic.IDynamicPluginConfiguration)3 IDependencyResolver (org.talend.hadoop.distribution.dynamic.resolver.IDependencyResolver)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 ExclusionNode (org.talend.designer.maven.aether.node.ExclusionNode)2 ESparkVersion (org.talend.hadoop.distribution.ESparkVersion)2 IDynamicDistributionsGroup (org.talend.hadoop.distribution.dynamic.IDynamicDistributionsGroup)2 ExclusionBean (org.talend.hadoop.distribution.dynamic.bean.ExclusionBean)2 ModuleBean (org.talend.hadoop.distribution.dynamic.bean.ModuleBean)2 IDynamicDistributionPreference (org.talend.hadoop.distribution.dynamic.pref.IDynamicDistributionPreference)2 DynamicDistributionSetupData (org.talend.repository.hadoopcluster.ui.dynamic.DynamicDistributionSetupData)2 FileNotFoundException (java.io.FileNotFoundException)1 List (java.util.List)1