use of org.talend.hadoop.distribution.model.DistributionBean in project tbd-studio-se by Talend.
the class HadoopDistributionsHelperTest method testGetHadoopDistributionByDisplayName.
@Test
public void testGetHadoopDistributionByDisplayName() {
DistributionBean hadoopDistribution = HadoopDistributionsHelper.HADOOP.getDistribution(null, true);
Assert.assertNull(hadoopDistribution);
hadoopDistribution = HadoopDistributionsHelper.HADOOP.getDistribution("ABC", true);
Assert.assertNull(hadoopDistribution);
}
use of org.talend.hadoop.distribution.model.DistributionBean in project tbd-studio-se by Talend.
the class HadoopDistributionsHelperTest method testGetHadoopDistribution.
@Test
public void testGetHadoopDistribution() {
DistributionBean hadoopDistribution = HadoopDistributionsHelper.HADOOP.getDistribution(null, false);
Assert.assertNull(hadoopDistribution);
hadoopDistribution = HadoopDistributionsHelper.HADOOP.getDistribution("ABC", false);
Assert.assertNull(hadoopDistribution);
}
use of org.talend.hadoop.distribution.model.DistributionBean 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();
}
use of org.talend.hadoop.distribution.model.DistributionBean in project tbd-studio-se by Talend.
the class CreateHBaseAction method hideAction.
@Override
protected boolean hideAction(RepositoryNode node) {
HadoopClusterConnectionItem hcConnectionItem = HCRepositoryUtil.getHCConnectionItemFromRepositoryNode(node);
if (hcConnectionItem != null) {
HadoopClusterConnection hcConnection = (HadoopClusterConnection) hcConnectionItem.getConnection();
DistributionBean hbaseDistribution = HadoopDistributionsHelper.HBASE.getDistribution(hcConnection.getDistribution(), false);
if (hbaseDistribution != null) {
IHDistributionVersion hdVersion = hbaseDistribution.getHDVersion(hcConnection.getDfVersion(), false);
if (hdVersion != null) {
// found, don't hide
return false;
}
}
}
return true;
}
use of org.talend.hadoop.distribution.model.DistributionBean in project tbd-studio-se by Talend.
the class DistributionsManager method removeDistribution.
private void removeDistribution(BundleContext bc, Map<String, DistributionBean> distributionsMap, ComponentType type, ServiceReference<? extends HadoopComponent> sr) {
HadoopComponent hc = bc.getService(sr);
final String distribution = hc.getDistribution();
final String distributionName = hc.getDistributionName();
String key = getKey(hc);
DistributionBean distributionBean = distributionsMap.get(key);
if (distributionBean == null) {
// not exsit, no need to remove
return;
} else {
// check the name and displayName
if (!distribution.equals(distributionBean.name) || !distributionName.equals(distributionBean.displayName)) {
// $NON-NLS-1$
CommonExceptionHandler.warn(" There are different distribution name for " + distributionBean);
// return;
}
}
clearCache();
final String version = hc.getVersion();
DistributionVersion versionBean = null;
if (hc instanceof AbstractDynamicDistributionTemplate) {
AbstractDynamicDistributionTemplate dynamicDistribution = (AbstractDynamicDistributionTemplate) hc;
versionBean = new DynamicDistributionVersion(dynamicDistribution, distributionBean, type, version, hc.getVersionName(type));
} else {
versionBean = new DistributionVersion(hc, distributionBean, version, hc.getVersionName(type));
}
// special condition for current version
versionBean.displayCondition = hc.getDisplayCondition(type);
distributionBean.removeVersion(versionBean);
distributionBean.setDefaultVersion(null);
DistributionVersion[] versions = distributionBean.getVersions();
if (versions == null || versions.length <= 0) {
distributionsMap.remove(key);
}
}
Aggregations