Search in sources :

Example 1 with IDynamicPluginConfiguration

use of org.talend.core.runtime.dynamic.IDynamicPluginConfiguration in project tbd-studio-se by Talend.

the class DynamicCDPSparkStreamingModuleGroupTemplate method getNodeModuleGroups.

@Override
public Map<NodeComponentTypeBean, Set<DistributionModuleGroup>> getNodeModuleGroups() throws Exception {
    Map<NodeComponentTypeBean, Set<DistributionModuleGroup>> nodeModuleGroups = super.getNodeModuleGroups();
    DynamicPluginAdapter pluginAdapter = getPluginAdapter();
    IDynamicPluginConfiguration configuration = pluginAdapter.getPluginConfiguration();
    String distribution = ICDPDistribution.DISTRIBUTION_NAME;
    String version = configuration.getId();
    buildNodeModuleGroups4SparkStreaming(pluginAdapter, nodeModuleGroups, distribution, version);
    return nodeModuleGroups;
}
Also used : Set(java.util.Set) DynamicPluginAdapter(org.talend.hadoop.distribution.dynamic.adapter.DynamicPluginAdapter) NodeComponentTypeBean(org.talend.hadoop.distribution.NodeComponentTypeBean) IDynamicPluginConfiguration(org.talend.core.runtime.dynamic.IDynamicPluginConfiguration)

Example 2 with IDynamicPluginConfiguration

use of org.talend.core.runtime.dynamic.IDynamicPluginConfiguration in project tbd-studio-se by Talend.

the class AbstractDynamicDistributionTemplate method registPluginExtensions.

@Override
public boolean registPluginExtensions() {
    if (registedPluginAdapter == null) {
        synchronized (registedPluginAdapterLock) {
            if (registedPluginAdapter == null) {
                DynamicPluginAdapter plugAdapter = getPluginAdapter();
                IDynamicPlugin plugin = plugAdapter.getPlugin();
                IDynamicPluginConfiguration pConfiguration = plugin.getPluginConfiguration();
                try {
                    plugin.setPluginConfiguration(null);
                    DynamicServiceUtil.addContribution(plugAdapter.getBundle(), plugin);
                    registedPluginAdapter = plugAdapter;
                    ILibrariesService libService = ILibrariesService.get();
                    if (libService != null) {
                        libService.resetModulesNeeded();
                    }
                    HadoopDistributionsHelper.updatePluginExtensionCacheVersion();
                    return true;
                } catch (Exception e) {
                    ExceptionHandler.process(e);
                } finally {
                    plugin.setPluginConfiguration(pConfiguration);
                }
            }
        }
    }
    return false;
}
Also used : DynamicPluginAdapter(org.talend.hadoop.distribution.dynamic.adapter.DynamicPluginAdapter) ILibrariesService(org.talend.core.model.general.ILibrariesService) IDynamicPlugin(org.talend.core.runtime.dynamic.IDynamicPlugin) IDynamicPluginConfiguration(org.talend.core.runtime.dynamic.IDynamicPluginConfiguration)

Example 3 with IDynamicPluginConfiguration

use of org.talend.core.runtime.dynamic.IDynamicPluginConfiguration in project tbd-studio-se by Talend.

the class DynamicHDFSModuleGroupTemplate method getNodeModuleGroups.

@Override
public Map<NodeComponentTypeBean, Set<DistributionModuleGroup>> getNodeModuleGroups() throws Exception {
    Map<NodeComponentTypeBean, Set<DistributionModuleGroup>> nodeModuleGroups = super.getNodeModuleGroups();
    DynamicPluginAdapter pluginAdapter = getPluginAdapter();
    IDynamicPluginConfiguration configuration = pluginAdapter.getPluginConfiguration();
    String distribution = configuration.getDistribution();
    String version = configuration.getId();
    buildNodeModuleGroups4HDFS(pluginAdapter, nodeModuleGroups, distribution, version);
    return nodeModuleGroups;
}
Also used : Set(java.util.Set) DynamicPluginAdapter(org.talend.hadoop.distribution.dynamic.adapter.DynamicPluginAdapter) NodeComponentTypeBean(org.talend.hadoop.distribution.NodeComponentTypeBean) IDynamicPluginConfiguration(org.talend.core.runtime.dynamic.IDynamicPluginConfiguration)

Example 4 with IDynamicPluginConfiguration

use of org.talend.core.runtime.dynamic.IDynamicPluginConfiguration in project tbd-studio-se by Talend.

the class DynamicDistribConfigAdapter method adapt.

public IDynamicPluginConfiguration adapt(IDynamicMonitor monitor) throws Exception {
    DynamicDistributionUtils.checkCancelOrNot(monitor);
    resolve();
    IDynamicPluginConfiguration pluginConfiguration = DynamicFactory.getInstance().createDynamicPluginConfiguration();
    TemplateBean templateBean = getTemplateBean();
    DynamicConfiguration configuration = getConfiguration();
    String distribution = templateBean.getDistribution();
    String templateId = templateBean.getTemplateId();
    if (!StringUtils.equals(distribution, configuration.getDistribution())) {
        throw new Exception(// $NON-NLS-1$
        Messages.getString("DynamicDistriConfigAdapter.diffDistri", distribution, configuration.getDistribution()));
    }
    String projectTechnicalName = ProjectManager.getInstance().getCurrentProject().getTechnicalLabel();
    // String id = projectTechnicalName + "_" + configuration.getId(); //$NON-NLS-1$
    String id = configuration.getId();
    pluginConfiguration.setId(id);
    pluginConfiguration.setName(configuration.getName());
    pluginConfiguration.setVersion(configuration.getVersion());
    pluginConfiguration.setDescription(configuration.getDescription());
    pluginConfiguration.setDistribution(distribution);
    pluginConfiguration.setTemplateId(templateId);
    pluginConfiguration.setRepository(configuration.getRemoteRepositoryUrl());
    pluginConfiguration.setAttribute(DynamicConstants.ATTR_PROJECT_TECHNICAL_NAME, projectTechnicalName);
    pluginConfiguration.setAttribute(DynamicConstants.ATTR_SELECTED_SPARK_VERSIONS, DynamicDistributionUtils.convert2SparkVersions(configuration.getSelectedSparkVersions()));
    return pluginConfiguration;
}
Also used : DynamicConfiguration(org.talend.hadoop.distribution.dynamic.DynamicConfiguration) TemplateBean(org.talend.hadoop.distribution.dynamic.bean.TemplateBean) IDynamicPluginConfiguration(org.talend.core.runtime.dynamic.IDynamicPluginConfiguration)

Example 5 with IDynamicPluginConfiguration

use of org.talend.core.runtime.dynamic.IDynamicPluginConfiguration in project tbd-studio-se by Talend.

the class DynamicCDPSparkBatchModuleGroupTemplate method getNodeModuleGroups.

@Override
public Map<NodeComponentTypeBean, Set<DistributionModuleGroup>> getNodeModuleGroups() throws Exception {
    Map<NodeComponentTypeBean, Set<DistributionModuleGroup>> nodeModuleGroups = super.getNodeModuleGroups();
    DynamicPluginAdapter pluginAdapter = getPluginAdapter();
    IDynamicPluginConfiguration configuration = pluginAdapter.getPluginConfiguration();
    String distribution = ICDPDistribution.DISTRIBUTION_NAME;
    String version = configuration.getId();
    buildNodeModuleGroups4SparkBatch(pluginAdapter, nodeModuleGroups, distribution, version);
    buildNodeModuleGroups4SparkStreaming(pluginAdapter, nodeModuleGroups, distribution, version);
    return nodeModuleGroups;
}
Also used : Set(java.util.Set) DynamicPluginAdapter(org.talend.hadoop.distribution.dynamic.adapter.DynamicPluginAdapter) NodeComponentTypeBean(org.talend.hadoop.distribution.NodeComponentTypeBean) IDynamicPluginConfiguration(org.talend.core.runtime.dynamic.IDynamicPluginConfiguration)

Aggregations

IDynamicPluginConfiguration (org.talend.core.runtime.dynamic.IDynamicPluginConfiguration)38 IDynamicPlugin (org.talend.core.runtime.dynamic.IDynamicPlugin)16 DynamicPluginAdapter (org.talend.hadoop.distribution.dynamic.adapter.DynamicPluginAdapter)10 Set (java.util.Set)6 NodeComponentTypeBean (org.talend.hadoop.distribution.NodeComponentTypeBean)6 File (java.io.File)5 InvocationTargetException (java.lang.reflect.InvocationTargetException)5 DummyDynamicMonitor (org.talend.designer.maven.aether.DummyDynamicMonitor)5 IDynamicMonitor (org.talend.designer.maven.aether.IDynamicMonitor)5 IDynamicDistributionTemplate (org.talend.hadoop.distribution.dynamic.template.IDynamicDistributionTemplate)4 ArrayList (java.util.ArrayList)3 Project (org.talend.core.model.general.Project)3 DynamicConfiguration (org.talend.hadoop.distribution.dynamic.DynamicConfiguration)3 DynamicDistributionSetupData (org.talend.repository.hadoopcluster.ui.dynamic.DynamicDistributionSetupData)3 IFolder (org.eclipse.core.resources.IFolder)2 IProject (org.eclipse.core.resources.IProject)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 Bundle (org.osgi.framework.Bundle)2 LoginException (org.talend.commons.exception.LoginException)2 PersistenceException (org.talend.commons.exception.PersistenceException)2