Search in sources :

Example 21 with DistributionBean

use of org.talend.hadoop.distribution.model.DistributionBean in project tbd-studio-se by Talend.

the class AbstractHadoopSubForm method isCurrentHadoopVersionSupportGroup.

private boolean isCurrentHadoopVersionSupportGroup() {
    boolean supportGroup = false;
    DistributionVersion distributionVersion;
    DistributionBean distributionBean = HadoopDistributionsHelper.HADOOP.getDistribution(distribution, false);
    if (distributionBean != null) {
        distributionVersion = distributionBean.getVersion(version, false);
        IHadoopDistributionService hadoopDistributionService = (IHadoopDistributionService) GlobalServiceRegister.getDefault().getService(IHadoopDistributionService.class);
        if (distributionVersion != null && hadoopDistributionService != null) {
            try {
                supportGroup = hadoopDistributionService.doSupportMethod(distributionVersion, "doSupportGroup");
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
    }
    return supportGroup;
}
Also used : IHadoopDistributionService(org.talend.core.hadoop.IHadoopDistributionService) DistributionVersion(org.talend.hadoop.distribution.model.DistributionVersion) DistributionBean(org.talend.hadoop.distribution.model.DistributionBean)

Example 22 with DistributionBean

use of org.talend.hadoop.distribution.model.DistributionBean in project tbd-studio-se by Talend.

the class HadoopImportConfsOptionPage method updateOptionPart.

private void updateOptionPart() {
    DistributionBean distribution = getDistribution();
    boolean supportRemote = distribution != null && (IHortonworksDistribution.DISTRIBUTION_NAME.equals(distribution.name) || IClouderaDistribution.DISTRIBUTION_NAME.equals(distribution.name));
    remoteBtn.setEnabled(supportRemote);
    // Synapse supports only manually configured wizard
    boolean supportManualOnly = distribution != null && ISynapseDistribution.DISTRIBUTION_NAME.equals(distribution.name);
    if (supportManualOnly) {
        remoteBtn.setEnabled(false);
        localBtn.setEnabled(false);
        manualBtn.setEnabled(true);
    }
}
Also used : DistributionBean(org.talend.hadoop.distribution.model.DistributionBean)

Example 23 with DistributionBean

use of org.talend.hadoop.distribution.model.DistributionBean in project tbd-studio-se by Talend.

the class HadoopImportConfsOptionPage method updateVersionPart.

private void updateVersionPart() {
    DistributionBean distribution = getDistribution();
    if (distribution == null) {
        return;
    }
    versionCombo.getCombo().setItems(distribution.getVersionsDisplay());
    DistributionVersion defaultVersion = distribution.getDefaultVersion();
    if (defaultVersion != null && defaultVersion.displayVersion != null) {
        versionCombo.getCombo().setText(defaultVersion.displayVersion);
    } else {
        versionCombo.getCombo().select(0);
    }
}
Also used : DistributionVersion(org.talend.hadoop.distribution.model.DistributionVersion) DistributionBean(org.talend.hadoop.distribution.model.DistributionBean)

Example 24 with DistributionBean

use of org.talend.hadoop.distribution.model.DistributionBean in project tbd-studio-se by Talend.

the class StandardHCInfoForm method addNavigatorFields.

private void addNavigatorFields() {
    DistributionBean distriBean = getDistribution();
    MRComponent currentDistribution;
    boolean isShow = false;
    try {
        currentDistribution = (MRComponent) DistributionFactory.buildDistribution(distriBean.getName(), hadoopVersison.getVersion());
        isShow = !getDistribution().useCustom() && currentDistribution.doSupportClouderaNavigator();
    } catch (Exception e) {
        ExceptionHandler.process(e);
    }
    if (!isShow) {
        return;
    }
    Composite clouderaNaviComposite = new Composite(propertiesComposite, SWT.NONE);
    GridLayout hadoopConfsCompLayout = new GridLayout(3, false);
    hadoopConfsCompLayout.marginWidth = 5;
    hadoopConfsCompLayout.marginHeight = 5;
    clouderaNaviComposite.setLayout(hadoopConfsCompLayout);
    clouderaNaviComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    useClouderaNaviBtn = new Button(clouderaNaviComposite, SWT.CHECK);
    // $NON-NLS-1$
    useClouderaNaviBtn.setText(Messages.getString("HadoopClusterForm.button.use_cloudera_navigator"));
    useClouderaNaviBtn.setLayoutData(new GridData());
    clouderaNaviButton = new Button(clouderaNaviComposite, SWT.NONE);
    clouderaNaviButton.setImage(ImageProvider.getImage(EImage.THREE_DOTS_ICON));
    clouderaNaviButton.setLayoutData(new GridData(30, 25));
    clouderaNaviButton.setEnabled(false);
    Label displayLabel = new Label(clouderaNaviComposite, SWT.NONE);
    displayLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) Button(org.eclipse.swt.widgets.Button) UtilsButton(org.talend.commons.ui.swt.formtools.UtilsButton) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) MRComponent(org.talend.hadoop.distribution.component.MRComponent) DistributionBean(org.talend.hadoop.distribution.model.DistributionBean)

Example 25 with DistributionBean

use of org.talend.hadoop.distribution.model.DistributionBean in project tbd-studio-se by Talend.

the class RetrieveLocalConfsServiceTest method getServiceWithDistribution.

private static IRetrieveConfsService getServiceWithDistribution(String distributionName, String versionName) {
    DistributionBean distribution = HadoopDistributionsHelper.HADOOP.getDistribution(distributionName, false);
    DistributionVersion version = distribution.getVersion(versionName, false);
    return new RetrieveLocalConfsService(confDir.getAbsolutePath(), version);
}
Also used : DistributionVersion(org.talend.hadoop.distribution.model.DistributionVersion) DistributionBean(org.talend.hadoop.distribution.model.DistributionBean)

Aggregations

DistributionBean (org.talend.hadoop.distribution.model.DistributionBean)29 DistributionVersion (org.talend.hadoop.distribution.model.DistributionVersion)15 Test (org.junit.Test)8 IHDistributionVersion (org.talend.core.runtime.hd.IHDistributionVersion)8 HadoopClusterConnection (org.talend.repository.model.hadoopcluster.HadoopClusterConnection)7 HadoopComponent (org.talend.hadoop.distribution.component.HadoopComponent)6 HadoopClusterConnectionItem (org.talend.repository.model.hadoopcluster.HadoopClusterConnectionItem)6 SparkComponent (org.talend.hadoop.distribution.component.SparkComponent)4 IHadoopDistributionService (org.talend.core.hadoop.IHadoopDistributionService)2 SparkStreamingComponent (org.talend.hadoop.distribution.component.SparkStreamingComponent)2 AbstractDynamicDistributionTemplate (org.talend.hadoop.distribution.dynamic.template.AbstractDynamicDistributionTemplate)2 DynamicDistributionVersion (org.talend.hadoop.distribution.model.DynamicDistributionVersion)2 HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)1 ModifyEvent (org.eclipse.swt.events.ModifyEvent)1 ModifyListener (org.eclipse.swt.events.ModifyListener)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 GridData (org.eclipse.swt.layout.GridData)1