use of org.talend.hadoop.distribution.model.DistributionVersion in project tbd-studio-se by Talend.
the class AdaptDeprecatedHadoopVersionsMigrationTask method execute.
@Override
public ExecutionResult execute(Item item) {
if (item instanceof HadoopClusterConnectionItem) {
DistributionBean[] distributions = HadoopDistributionsHelper.HADOOP.getDistributions();
if (distributions != null && distributions.length > 0) {
boolean modified = false;
HadoopClusterConnectionItem hcItem = (HadoopClusterConnectionItem) item;
HadoopClusterConnection hcConnection = (HadoopClusterConnection) hcItem.getConnection();
DistributionBean distributionBean = HadoopDistributionsHelper.HADOOP.getDistribution(hcConnection.getDistribution(), false);
if (distributionBean == null) {
distributionBean = distributions[0];
hcConnection.setDistribution(distributionBean.getName());
modified = true;
}
String version = hcConnection.getDfVersion();
DistributionVersion distributionVersion = distributionBean.getVersion(version, false);
if (distributionVersion == null) {
DistributionVersion[] versions = distributionBean.getVersions();
if (versions != null && versions.length > 0) {
hcConnection.setDfVersion(versions[0].getVersion());
modified = true;
}
}
if (modified) {
try {
ProxyRepositoryFactory.getInstance().save(hcItem, true);
return ExecutionResult.SUCCESS_NO_ALERT;
} catch (PersistenceException e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
}
}
}
return ExecutionResult.NOTHING_TO_DO;
}
use of org.talend.hadoop.distribution.model.DistributionVersion in project tbd-studio-se by Talend.
the class StandardHCInfoForm method isCurrentHadoopVersionSupportGroup.
private boolean isCurrentHadoopVersionSupportGroup() {
boolean supportGroup = false;
final DistributionVersion distributionVersion = getDistributionVersion();
if (distributionVersion != null && distributionVersion.hadoopComponent != null) {
supportGroup = distributionVersion.hadoopComponent.doSupportGroup();
}
return supportGroup;
}
use of org.talend.hadoop.distribution.model.DistributionVersion 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;
}
use of org.talend.hadoop.distribution.model.DistributionVersion 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);
}
}
use of org.talend.hadoop.distribution.model.DistributionVersion 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);
}
Aggregations