Search in sources :

Example 6 with DistributionVersion

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

the class StandardHCInfoForm method isCurrentHadoopVersionSupportYarn.

private boolean isCurrentHadoopVersionSupportYarn() {
    boolean supportYarn = false;
    final DistributionVersion distributionVersion = getDistributionVersion();
    if (distributionVersion != null && distributionVersion.hadoopComponent != null) {
        supportYarn = distributionVersion.hadoopComponent.isHadoop2() || distributionVersion.hadoopComponent.isHadoop3();
    }
    return supportYarn;
}
Also used : DistributionVersion(org.talend.hadoop.distribution.model.DistributionVersion)

Example 7 with DistributionVersion

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

the class StandardHCInfoForm method isCurrentHadoopVersionSupportSecurity.

private boolean isCurrentHadoopVersionSupportSecurity() {
    boolean supportSecurity = false;
    final DistributionVersion distributionVersion = getDistributionVersion();
    if (distributionVersion != null && distributionVersion.hadoopComponent != null) {
        supportSecurity = distributionVersion.hadoopComponent.doSupportKerberos();
    }
    return supportSecurity;
}
Also used : DistributionVersion(org.talend.hadoop.distribution.model.DistributionVersion)

Example 8 with DistributionVersion

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

the class StandardHCInfoForm method updateForm.

@Override
public void updateForm() {
    HadoopClusterConnection connection = getConnection();
    final DistributionVersion distributionVersion = getDistributionVersion();
    if (distributionVersion.distribution.useCustom()) {
        hideControl(customGroup, false);
        String authModeName = connection.getAuthMode();
        if (authModeName != null) {
            EAuthenticationMode authMode = EAuthenticationMode.getAuthenticationByName(authModeName, false);
            switch(authMode) {
                case KRB:
                    kerberosBtn.setEnabled(true);
                    namenodePrincipalText.setEditable(kerberosBtn.isEnabled() && kerberosBtn.getSelection());
                    jtOrRmPrincipalText.setEditable(namenodePrincipalText.getEditable());
                    jobHistoryPrincipalText.setEditable(isJobHistoryPrincipalEditable());
                    keytabBtn.setEnabled(kerberosBtn.isEnabled() && kerberosBtn.getSelection());
                    keytabPrincipalText.setEditable(keytabBtn.isEnabled() && keytabBtn.getSelection());
                    keytabText.setEditable(keytabBtn.isEnabled() && keytabBtn.getSelection());
                    keytabPrincipalText.setHideWidgets(!(kerberosBtn.isEnabled() && kerberosBtn.getSelection() && keytabBtn.isEnabled() && keytabBtn.getSelection()));
                    keytabText.setVisible(kerberosBtn.isEnabled() && kerberosBtn.getSelection() && keytabBtn.isEnabled() && keytabBtn.getSelection());
                    userNameText.setEditable(false);
                    groupText.setEditable(false);
                    // userNameText.setHideWidgets(true);
                    userNameText.setVisible(false);
                    groupText.setHideWidgets(true);
                    hideKerberosControl(!kerberosBtn.getSelection());
                    hideMaprTicketControl(true);
                    maprTPasswordText.setEditable(false);
                    break;
                case UGI:
                    kerberosBtn.setEnabled(true);
                    namenodePrincipalText.setEditable(kerberosBtn.isEnabled() && kerberosBtn.getSelection());
                    jtOrRmPrincipalText.setEditable(namenodePrincipalText.getEditable());
                    jobHistoryPrincipalText.setEditable(namenodePrincipalText.getEditable());
                    keytabBtn.setEnabled(kerberosBtn.isEnabled() && kerberosBtn.getSelection());
                    keytabPrincipalText.setEditable(keytabBtn.isEnabled() && keytabBtn.getSelection());
                    keytabText.setEditable(keytabBtn.isEnabled() && keytabBtn.getSelection());
                    keytabPrincipalText.setHideWidgets(!(kerberosBtn.isEnabled() && kerberosBtn.getSelection() && keytabBtn.isEnabled() && keytabBtn.getSelection()));
                    keytabText.setVisible(kerberosBtn.isEnabled() && kerberosBtn.getSelection() && keytabBtn.isEnabled() && keytabBtn.getSelection());
                    userNameText.setEditable(!(kerberosBtn.isEnabled() && kerberosBtn.getSelection()));
                    groupText.setEditable(true);
                    userNameText.setHideWidgets(kerberosBtn.isEnabled() && kerberosBtn.getSelection());
                    groupText.setHideWidgets(false);
                    hideKerberosControl(!kerberosBtn.getSelection());
                    // maprt
                    hideMaprTicketChildControl(!maprTBtn.getSelection());
                    maprTPasswordText.setEditable(maprTBtn.isEnabled() && (maprTBtn.getSelection() && !(kerberosBtn.isEnabled() && kerberosBtn.getSelection())));
                    break;
                default:
                    kerberosBtn.setEnabled(false);
                    namenodePrincipalText.setEditable(false);
                    jtOrRmPrincipalText.setEditable(false);
                    jobHistoryPrincipalText.setEditable(false);
                    keytabBtn.setEnabled(false);
                    keytabPrincipalText.setEditable(false);
                    keytabText.setEditable(false);
                    userNameText.setEditable(true);
                    groupText.setEditable(false);
                    userNameText.setHideWidgets(false);
                    groupText.setHideWidgets(true);
                    hideKerberosControl(true);
                    hideMaprTicketControl(true);
                    maprTPasswordText.setEditable(false);
                    break;
            }
        }
    } else {
        hideControl(customGroup, true);
        kerberosBtn.setEnabled(isCurrentHadoopVersionSupportSecurity());
        namenodePrincipalText.setEditable(kerberosBtn.isEnabled() && kerberosBtn.getSelection());
        jtOrRmPrincipalText.setEditable(namenodePrincipalText.getEditable());
        jobHistoryPrincipalText.setEditable(isJobHistoryPrincipalEditable());
        keytabBtn.setEnabled(kerberosBtn.isEnabled() && kerberosBtn.getSelection());
        keytabPrincipalText.setEditable(keytabBtn.isEnabled() && keytabBtn.getSelection());
        keytabText.setEditable(keytabBtn.isEnabled() && keytabBtn.getSelection());
        keytabPrincipalText.setHideWidgets(!(kerberosBtn.isEnabled() && kerberosBtn.getSelection() && keytabBtn.isEnabled() && keytabBtn.getSelection()));
        keytabText.setVisible(kerberosBtn.isEnabled() && kerberosBtn.getSelection() && keytabBtn.isEnabled() && keytabBtn.getSelection());
        groupText.setEditable(isCurrentHadoopVersionSupportGroup());
        userNameText.setEditable(!kerberosBtn.getSelection());
        if (isCurrentHadoopVersionSupportGroup()) {
            userNameText.setHideWidgets(kerberosBtn.getSelection());
        } else {
            userNameText.setVisible(!kerberosBtn.getSelection());
        }
        groupText.setHideWidgets(!isCurrentHadoopVersionSupportGroup());
        hideKerberosControl(!kerberosBtn.getSelection());
        // maprt
        hideControl(maprTBtn, !isCurrentHadoopVersionSupportMapRTicket());
        maprTBtn.setEnabled(isCurrentHadoopVersionSupportMapRTicket());
        maprTPasswordText.setEditable(maprTBtn.isEnabled() && (maprTBtn.getSelection() && !(kerberosBtn.isEnabled() && kerberosBtn.getSelection())));
        maprTClusterText.setEditable(maprTBtn.isEnabled() && maprTBtn.getSelection());
        maprTDurationText.setEditable(maprTBtn.isEnabled() && maprTBtn.getSelection());
        setMaprTHomeDirBtn.setEnabled(maprTBtn.isEnabled() && maprTBtn.getSelection());
        setHadoopLoginBtn.setEnabled(maprTBtn.isEnabled() && maprTBtn.getSelection());
        preloadAuthentificationBtn.setEnabled(maprTBtn.isEnabled() && maprTBtn.getSelection());
        hideMaprTicketChildControl(!maprTBtn.getSelection());
    }
    updateMRRelatedContent();
    updateConnectionContent();
    hideWebHDFSControl(!isCurrentHadoopVersionSupportWebHDFS());
    if (isContextMode()) {
        adaptFormToEditable();
    }
    hideFieldsOnSparkMode();
}
Also used : DistributionVersion(org.talend.hadoop.distribution.model.DistributionVersion) EAuthenticationMode(org.talend.core.hadoop.version.EAuthenticationMode) HadoopClusterConnection(org.talend.repository.model.hadoopcluster.HadoopClusterConnection)

Example 9 with DistributionVersion

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

the class HadoopClusterForm method switchToInfoForm.

private void switchToInfoForm() {
    if (hcInfoForm != null) {
        hcInfoForm.dispose();
    }
    DistributionBean hadoopDistribution = HadoopDistributionsHelper.HADOOP.getDistribution(distributionCombo.getText(), true);
    DistributionVersion hadoopVersion = hadoopDistribution.getVersion(versionCombo.getText(), true);
    if (HCVersionUtil.isHDI(getConnection())) {
        hcInfoForm = new HDIInfoForm(this, connectionItem, existingNamesArray, creation);
    } else if (HCVersionUtil.isSynapse(getConnection())) {
        hcInfoForm = new SynapseInfoForm(this, connectionItem, existingNamesArray, creation, hadoopDistribution, hadoopVersion);
    } else if (HCVersionUtil.isGoogleDataproc(getConnection())) {
        hcInfoForm = new GoogleDataprocInfoForm(this, connectionItem, existingNamesArray, creation, hadoopDistribution, hadoopVersion);
    } else if (HCVersionUtil.isDataBricks(getConnection())) {
        hcInfoForm = new DataBricksInfoForm(this, connectionItem, existingNamesArray, creation, hadoopDistribution, hadoopVersion);
    } else if (HCVersionUtil.isExecutedThroughKnox(getConnection()) && useKnoxButton.getSelection()) {
        hcInfoForm = new KnoxInfoForm(this, connectionItem, existingNamesArray, creation, hadoopDistribution, hadoopVersion);
    } else {
        hcInfoForm = new StandardHCInfoForm(this, connectionItem, existingNamesArray, creation, hadoopDistribution, hadoopVersion);
    }
    hcInfoForm.setReadOnly(readOnly);
    hcInfoForm.setListener(listener);
    hcInfoForm.updateForm();
    hcInfoForm.checkFieldsValue();
    this.layout();
}
Also used : DistributionVersion(org.talend.hadoop.distribution.model.DistributionVersion) DistributionBean(org.talend.hadoop.distribution.model.DistributionBean)

Example 10 with DistributionVersion

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

the class HDIInfoForm method isCurrentHadoopVersionSupportStorage.

private boolean isCurrentHadoopVersionSupportStorage() {
    boolean supportStorage = false;
    final DistributionVersion distributionVersion = getDistributionVersion();
    if (distributionVersion != null && distributionVersion.hadoopComponent != null) {
        // $NON-NLS-1$
        supportStorage = "MICROSOFT_HD_INSIGHT_4_0".equals(distributionVersion.getVersion());
    }
    return supportStorage;
}
Also used : DistributionVersion(org.talend.hadoop.distribution.model.DistributionVersion)

Aggregations

DistributionVersion (org.talend.hadoop.distribution.model.DistributionVersion)23 DistributionBean (org.talend.hadoop.distribution.model.DistributionBean)15 HadoopComponent (org.talend.hadoop.distribution.component.HadoopComponent)5 SparkComponent (org.talend.hadoop.distribution.component.SparkComponent)4 Test (org.junit.Test)3 IHDistributionVersion (org.talend.core.runtime.hd.IHDistributionVersion)3 HadoopClusterConnection (org.talend.repository.model.hadoopcluster.HadoopClusterConnection)3 ESparkVersion (org.talend.hadoop.distribution.ESparkVersion)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 LinkedHashSet (java.util.LinkedHashSet)1 Map (java.util.Map)1 Set (java.util.Set)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 Ignore (org.junit.Ignore)1 PersistenceException (org.talend.commons.exception.PersistenceException)1