Search in sources :

Example 21 with SimpleComponentCondition

use of org.talend.hadoop.distribution.condition.SimpleComponentCondition in project tbd-studio-se by Talend.

the class DynamicCDHMapReduceModuleGroup method getModuleGroups.

@Override
public Set<DistributionModuleGroup> getModuleGroups() throws Exception {
    Set<DistributionModuleGroup> moduleGroups = new HashSet<>();
    Set<DistributionModuleGroup> moduleGroupsFromSuper = super.getModuleGroups();
    if (moduleGroupsFromSuper != null && !moduleGroupsFromSuper.isEmpty()) {
        moduleGroups.addAll(moduleGroupsFromSuper);
    }
    ComponentCondition conditionUseNavigator = new SimpleComponentCondition(new BasicExpression(MRConstant.USE_CLOUDERA_NAVIGATOR));
    String talendClouderaNaviRuntimeId = getPluginAdapter().getRuntimeModuleGroupIdByTemplateId(DynamicCDHModuleGroupConstant.TALEND_CLOUDERA_CDH_NAVIGATOR.getModuleName());
    checkRuntimeId(talendClouderaNaviRuntimeId);
    if (StringUtils.isNotBlank(talendClouderaNaviRuntimeId)) {
        moduleGroups.add(new DistributionModuleGroup(talendClouderaNaviRuntimeId, true, conditionUseNavigator));
    }
    return moduleGroups;
}
Also used : BasicExpression(org.talend.hadoop.distribution.condition.BasicExpression) SimpleComponentCondition(org.talend.hadoop.distribution.condition.SimpleComponentCondition) SimpleComponentCondition(org.talend.hadoop.distribution.condition.SimpleComponentCondition) ComponentCondition(org.talend.hadoop.distribution.condition.ComponentCondition) DistributionModuleGroup(org.talend.hadoop.distribution.DistributionModuleGroup) HashSet(java.util.HashSet)

Example 22 with SimpleComponentCondition

use of org.talend.hadoop.distribution.condition.SimpleComponentCondition in project tbd-studio-se by Talend.

the class DynamicCDHSparkBatchModuleGroup method initConditions.

@Override
protected void initConditions() {
    // $NON-NLS-1$
    conditionSpark1 = new SimpleComponentCondition(new BasicExpression("SUPPORTED_SPARK_VERSION", EqualityOperator.EQ, ESparkVersion.SPARK_1_6.getSparkVersion()));
    conditionSpark2 = new MultiComponentCondition(// $NON-NLS-1$
    new BasicExpression("SUPPORTED_SPARK_VERSION", EqualityOperator.EQ, ESparkVersion.SPARK_2_2.getSparkVersion()), BooleanOperator.OR, // $NON-NLS-1$
    new BasicExpression("SUPPORTED_SPARK_VERSION", EqualityOperator.EQ, ESparkVersion.SPARK_2_4_X.getSparkVersion()));
}
Also used : BasicExpression(org.talend.hadoop.distribution.condition.BasicExpression) SimpleComponentCondition(org.talend.hadoop.distribution.condition.SimpleComponentCondition) MultiComponentCondition(org.talend.hadoop.distribution.condition.MultiComponentCondition)

Example 23 with SimpleComponentCondition

use of org.talend.hadoop.distribution.condition.SimpleComponentCondition in project tbd-studio-se by Talend.

the class EMR5290SqoopModuleGroup method getModuleGroups.

public static Set<DistributionModuleGroup> getModuleGroups() {
    Set<DistributionModuleGroup> hs = new HashSet<>();
    hs.add(new DistributionModuleGroup(EMR5290Constant.SQOOP_MODULE_GROUP.getModuleName()));
    hs.add(new DistributionModuleGroup(EMR5290Constant.MAPREDUCE_MODULE_GROUP.getModuleName()));
    hs.add(new DistributionModuleGroup(EMR5290Constant.HDFS_MODULE_GROUP.getModuleName()));
    ComponentCondition parquetOutputCondition = new SimpleComponentCondition(new BasicExpression(SqoopConstant.FILE_FORMAT, EqualityOperator.EQ, SqoopConstant.PAQUET_OUTPUT_FORMAT));
    hs.add(new DistributionModuleGroup(EMR5290Constant.SQOOP_PARQUET_MODULE_GROUP.getModuleName(), true, parquetOutputCondition));
    return hs;
}
Also used : BasicExpression(org.talend.hadoop.distribution.condition.BasicExpression) SimpleComponentCondition(org.talend.hadoop.distribution.condition.SimpleComponentCondition) SimpleComponentCondition(org.talend.hadoop.distribution.condition.SimpleComponentCondition) ComponentCondition(org.talend.hadoop.distribution.condition.ComponentCondition) DistributionModuleGroup(org.talend.hadoop.distribution.DistributionModuleGroup) HashSet(java.util.HashSet)

Aggregations

SimpleComponentCondition (org.talend.hadoop.distribution.condition.SimpleComponentCondition)23 BasicExpression (org.talend.hadoop.distribution.condition.BasicExpression)20 MultiComponentCondition (org.talend.hadoop.distribution.condition.MultiComponentCondition)17 ComponentCondition (org.talend.hadoop.distribution.condition.ComponentCondition)16 HashSet (java.util.HashSet)12 DistributionModuleGroup (org.talend.hadoop.distribution.DistributionModuleGroup)10 DynamicPluginAdapter (org.talend.hadoop.distribution.dynamic.adapter.DynamicPluginAdapter)6 NestedComponentCondition (org.talend.hadoop.distribution.condition.NestedComponentCondition)4 ShowExpression (org.talend.hadoop.distribution.condition.ShowExpression)4 Set (java.util.Set)3 Expression (org.talend.hadoop.distribution.condition.Expression)3 LinkedNodeExpression (org.talend.hadoop.distribution.condition.LinkedNodeExpression)3 RawExpression (org.talend.hadoop.distribution.condition.RawExpression)3 HashMap (java.util.HashMap)2 LinkedHashSet (java.util.LinkedHashSet)1 Map (java.util.Map)1 Test (org.junit.Test)1 ComponentType (org.talend.hadoop.distribution.ComponentType)1 ESparkVersion (org.talend.hadoop.distribution.ESparkVersion)1 BooleanExpression (org.talend.hadoop.distribution.condition.BooleanExpression)1