use of org.talend.hadoop.distribution.condition.ShowExpression in project tbd-studio-se by Talend.
the class DynamicHiveModuleGroup method getModuleGroups.
@Override
public Set<DistributionModuleGroup> getModuleGroups() throws Exception {
Set<DistributionModuleGroup> hs = new HashSet<>();
DynamicPluginAdapter pluginAdapter = getPluginAdapter();
String hiveRuntimeId = pluginAdapter.getRuntimeModuleGroupIdByTemplateId(DynamicModuleGroupConstant.HIVE_MODULE_GROUP.getModuleName());
String hdfsRuntimeId = pluginAdapter.getRuntimeModuleGroupIdByTemplateId(DynamicModuleGroupConstant.HDFS_MODULE_GROUP.getModuleName());
String mrRuntimeId = pluginAdapter.getRuntimeModuleGroupIdByTemplateId(DynamicModuleGroupConstant.MAPREDUCE_MODULE_GROUP.getModuleName());
String hiveHBaseRuntimeId = pluginAdapter.getRuntimeModuleGroupIdByTemplateId(DynamicModuleGroupConstant.HIVE_HBASE_MODULE_GROUP.getModuleName());
checkRuntimeId(hiveRuntimeId);
checkRuntimeId(hdfsRuntimeId);
checkRuntimeId(mrRuntimeId);
checkRuntimeId(hiveHBaseRuntimeId);
if (StringUtils.isNotBlank(hiveRuntimeId)) {
hs.add(new DistributionModuleGroup(hiveRuntimeId));
}
if (StringUtils.isNotBlank(hdfsRuntimeId)) {
hs.add(new DistributionModuleGroup(hdfsRuntimeId));
}
if (StringUtils.isNotBlank(mrRuntimeId)) {
hs.add(new DistributionModuleGroup(mrRuntimeId));
}
if (StringUtils.isNotBlank(hiveHBaseRuntimeId)) {
// The following condition instance stands for:
// (isShow[STORE_BY_HBASE] AND STORE_BY_HBASE=='true')
ComponentCondition hbaseLoaderCondition = new MultiComponentCondition(//
new SimpleComponentCondition(new BasicExpression(HiveConstant.HIVE_CONFIGURATION_COMPONENT_HBASEPARAMETER)), //
BooleanOperator.AND, new SimpleComponentCondition(new ShowExpression(HiveConstant.HIVE_CONFIGURATION_COMPONENT_HBASEPARAMETER)));
// The Hive components need to import some hbase libraries if the "Use HBase storage" is checked.
hs.add(new DistributionModuleGroup(hiveHBaseRuntimeId, false, hbaseLoaderCondition));
}
return hs;
}
use of org.talend.hadoop.distribution.condition.ShowExpression in project tbd-studio-se by Talend.
the class EMR5290HiveModuleGroup method getModuleGroups.
public static Set<DistributionModuleGroup> getModuleGroups() {
ComponentCondition hbaseLoaderCondition = new MultiComponentCondition(new SimpleComponentCondition(new BasicExpression(//
HiveConstant.HIVE_CONFIGURATION_COMPONENT_HBASEPARAMETER)), //
BooleanOperator.AND, new SimpleComponentCondition(new ShowExpression(HiveConstant.HIVE_CONFIGURATION_COMPONENT_HBASEPARAMETER)));
Set<DistributionModuleGroup> hs = new HashSet<>();
hs.add(new DistributionModuleGroup(EMR5290Constant.HIVE_MODULE_GROUP.getModuleName()));
hs.add(new DistributionModuleGroup(EMR5290Constant.HDFS_MODULE_GROUP.getModuleName()));
hs.add(new DistributionModuleGroup(EMR5290Constant.MAPREDUCE_MODULE_GROUP.getModuleName()));
// The Hive components need to import some hbase libraries if the "Use HBase storage" is checked.
hs.add(new DistributionModuleGroup(EMR5290Constant.HIVE_HBASE_MODULE_GROUP.getModuleName(), false, hbaseLoaderCondition));
return hs;
}
use of org.talend.hadoop.distribution.condition.ShowExpression in project tbd-studio-se by Talend.
the class AbstractDistribution method buildModuleGroups.
protected Map<ComponentType, Set<DistributionModuleGroup>> buildModuleGroups() {
Map<ComponentType, Set<DistributionModuleGroup>> result = new HashMap<>();
// HCatalog
result.put(ComponentType.HCATALOG, ModuleGroupsUtils.getModuleGroups(null, ModuleGroupName.HDFS.get(this.getVersion()), false));
// HDFS
result.put(ComponentType.HDFS, ModuleGroupsUtils.getModuleGroups(null, ModuleGroupName.HDFS.get(this.getVersion()), false));
// Hbase
result.put(ComponentType.HBASE, ModuleGroupsUtils.getModuleGroups(null, ModuleGroupName.HBASE.get(this.getVersion()), true));
// Hive
ComponentCondition hiveOnHbaseCondition = new MultiComponentCondition(new SimpleComponentCondition(new BasicExpression(//
HiveConstant.HIVE_CONFIGURATION_COMPONENT_HBASEPARAMETER)), //
BooleanOperator.AND, new SimpleComponentCondition(new ShowExpression(HiveConstant.HIVE_CONFIGURATION_COMPONENT_HBASEPARAMETER)));
Set<DistributionModuleGroup> hiveModuleGroups = new HashSet<>();
hiveModuleGroups.addAll(ModuleGroupsUtils.getModuleGroups(null, ModuleGroupName.HIVE.get(this.getVersion()), false));
hiveModuleGroups.addAll(ModuleGroupsUtils.getModuleGroups(hiveOnHbaseCondition, ModuleGroupName.HBASE.get(this.getVersion()), false));
result.put(ComponentType.HIVE, hiveModuleGroups);
// Hive on Spark
result.put(ComponentType.HIVEONSPARK, ModuleGroupsUtils.getModuleGroups((ComponentCondition) null, ModuleGroupName.HIVE.get(this.getVersion()), true));
// Sqoop
result.put(ComponentType.SQOOP, SqoopModuleGroup.getModuleGroups(this.getVersion()));
result.put(ComponentType.SPARKBATCH, ModuleGroupsUtils.getModuleGroups(null, ModuleGroupName.SPARK_BATCH.get(this.getVersion()), true));
result.put(ComponentType.SPARKSTREAMING, ModuleGroupsUtils.getModuleGroups(null, ModuleGroupName.SPARK_STREAMING.get(this.getVersion()), true));
return result;
}
use of org.talend.hadoop.distribution.condition.ShowExpression in project tbd-studio-se by Talend.
the class DistributionVersionModule method getModuleRequiredIf.
public ComponentCondition getModuleRequiredIf() {
ComponentCondition condition;
// The import is needed only if the good version and the good distribution are selected, and
// if the Distribution is shown. The second condition to take the
// USE_EXISTING_CONNECTIOn into account.
final ComponentType componentType = distributionVersion.distribution.componentType;
Expression distributionSelected = new BasicExpression(componentType.getDistributionParameter(), EqualityOperator.EQ, distributionVersion.distribution.name);
Expression distributionVersionSelected = new BasicExpression(componentType.getVersionParameter(), EqualityOperator.EQ, distributionVersion.version);
Expression distributionShown = new ShowExpression(componentType.getDistributionParameter());
condition = new MultiComponentCondition(new SimpleComponentCondition(distributionSelected), BooleanOperator.AND, new MultiComponentCondition(new SimpleComponentCondition(distributionVersionSelected), BooleanOperator.AND, new SimpleComponentCondition(distributionShown)));
if (moduleGroup.getRequiredIf() != null) {
condition = new MultiComponentCondition(condition, BooleanOperator.AND, new NestedComponentCondition(moduleGroup.getRequiredIf()));
}
return condition;
}
Aggregations