use of org.talend.hadoop.distribution.condition.NestedComponentCondition in project tbd-studio-se by Talend.
the class DynamicHDPSparkStreamingKinesisNodeModuleGroup method getModuleGroups.
@Override
public Set<DistributionModuleGroup> getModuleGroups(String distribution, String version) throws Exception {
Set<DistributionModuleGroup> moduleGroups = new HashSet<>();
Set<DistributionModuleGroup> moduleGroupsFromSuper = super.getModuleGroups(distribution, version);
if (moduleGroupsFromSuper != null && !moduleGroupsFromSuper.isEmpty()) {
moduleGroups.addAll(moduleGroupsFromSuper);
}
DynamicPluginAdapter pluginAdapter = getPluginAdapter();
String spark2KinesisMrRequiredRuntimeId = pluginAdapter.getRuntimeModuleGroupIdByTemplateId(DynamicModuleGroupConstant.SPARK2_KINESIS_MRREQUIRED_MODULE_GROUP.getModuleName());
checkRuntimeId(spark2KinesisMrRequiredRuntimeId);
if (StringUtils.isNotBlank(spark2KinesisMrRequiredRuntimeId)) {
DistributionModuleGroup dmgSpark1 = new DistributionModuleGroup(spark2KinesisMrRequiredRuntimeId, true, new NestedComponentCondition(new MultiComponentCondition(new SparkStreamingLinkedNodeCondition(distribution, version).getCondition(), BooleanOperator.AND, spark2Condition)));
moduleGroups.add(dmgSpark1);
}
return moduleGroups;
}
use of org.talend.hadoop.distribution.condition.NestedComponentCondition 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;
}
use of org.talend.hadoop.distribution.condition.NestedComponentCondition in project tbd-studio-se by Talend.
the class DynamicSparkStreamingKafkaAssemblyModuleGroup method getModuleGroups.
@Override
public Set<DistributionModuleGroup> getModuleGroups(String distribution, String version) throws Exception {
Set<DistributionModuleGroup> hs = new HashSet<>();
DynamicPluginAdapter pluginAdapter = getPluginAdapter();
String sparkKafkaAssemblyMrRequiredRuntimeId = pluginAdapter.getRuntimeModuleGroupIdByTemplateId(DynamicModuleGroupConstant.SPARK_KAFKA_ASSEMBLY_MRREQUIRED_MODULE_GROUP.getModuleName());
String spark2KafkaAssemblyMrRequiredRuntimeId = pluginAdapter.getRuntimeModuleGroupIdByTemplateId(DynamicModuleGroupConstant.SPARK2_KAFKA_ASSEMBLY_MRREQUIRED_MODULE_GROUP.getModuleName());
checkRuntimeId(sparkKafkaAssemblyMrRequiredRuntimeId);
checkRuntimeId(spark2KafkaAssemblyMrRequiredRuntimeId);
if (StringUtils.isNotBlank(sparkKafkaAssemblyMrRequiredRuntimeId)) {
// Spark 1.6 Kafka assembly
DistributionModuleGroup dmgSpark16 = new DistributionModuleGroup(sparkKafkaAssemblyMrRequiredRuntimeId, true, new NestedComponentCondition(new MultiComponentCondition(new SparkStreamingLinkedNodeCondition(distribution, version, SparkStreamingConstant.KAFKA_SPARKCONFIGURATION_LINKEDPARAMETER).getCondition(), BooleanOperator.AND, spark1Condition)));
hs.add(dmgSpark16);
}
if (StringUtils.isNotBlank(spark2KafkaAssemblyMrRequiredRuntimeId)) {
// Spark 2.1 Kafka assembly
DistributionModuleGroup dmgSpark21 = new DistributionModuleGroup(spark2KafkaAssemblyMrRequiredRuntimeId, true, new NestedComponentCondition(new MultiComponentCondition(new SparkStreamingLinkedNodeCondition(distribution, version, SparkStreamingConstant.KAFKA_SPARKCONFIGURATION_LINKEDPARAMETER).getCondition(), BooleanOperator.AND, spark2Condition)));
hs.add(dmgSpark21);
}
return hs;
}
Aggregations