Search in sources :

Example 11 with SparkBatchLinkedNodeCondition

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

the class DynamicSparkBatchS3NodeModuleGroup method getModuleGroups.

@Override
public Set<DistributionModuleGroup> getModuleGroups(String distribution, String version) throws Exception {
    Set<DistributionModuleGroup> hs = new HashSet<>();
    DynamicPluginAdapter pluginAdapter = getPluginAdapter();
    String sparkS3MrRequiredRuntimeId = pluginAdapter.getRuntimeModuleGroupIdByTemplateId(DynamicModuleGroupConstant.SPARK_S3_MRREQUIRED_MODULE_GROUP.getModuleName());
    checkRuntimeId(sparkS3MrRequiredRuntimeId);
    if (StringUtils.isNotBlank(sparkS3MrRequiredRuntimeId)) {
        DistributionModuleGroup dmg = new DistributionModuleGroup(sparkS3MrRequiredRuntimeId, true, new SparkBatchLinkedNodeCondition(distribution, version, SparkBatchConstant.SPARK_BATCH_S3_SPARKCONFIGURATION_LINKEDPARAMETER).getCondition());
        hs.add(dmg);
    }
    return hs;
}
Also used : DynamicPluginAdapter(org.talend.hadoop.distribution.dynamic.adapter.DynamicPluginAdapter) SparkBatchLinkedNodeCondition(org.talend.hadoop.distribution.condition.common.SparkBatchLinkedNodeCondition) DistributionModuleGroup(org.talend.hadoop.distribution.DistributionModuleGroup) HashSet(java.util.HashSet)

Example 12 with SparkBatchLinkedNodeCondition

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

the class DynamicCDHGraphFramesNodeModuleGroup method getModuleGroups.

@Override
public Set<DistributionModuleGroup> getModuleGroups(String distribution, String version) throws Exception {
    Set<DistributionModuleGroup> hs = new HashSet<>();
    DynamicPluginAdapter pluginAdapter = getPluginAdapter();
    String graphFramesMrRequiredRuntimeId = pluginAdapter.getRuntimeModuleGroupIdByTemplateId(DynamicModuleGroupConstant.GRAPHFRAMES_MRREQUIRED_MODULE_GROUP.getModuleName());
    checkRuntimeId(graphFramesMrRequiredRuntimeId);
    if (StringUtils.isNotBlank(graphFramesMrRequiredRuntimeId)) {
        DistributionModuleGroup dmg = new DistributionModuleGroup(graphFramesMrRequiredRuntimeId, true, new SparkBatchLinkedNodeCondition(distribution, version, SparkBatchConstant.SPARK_BATCH_SPARKCONFIGURATION_LINKEDPARAMETER).getCondition());
        hs.add(dmg);
    }
    return hs;
}
Also used : DynamicPluginAdapter(org.talend.hadoop.distribution.dynamic.adapter.DynamicPluginAdapter) SparkBatchLinkedNodeCondition(org.talend.hadoop.distribution.condition.common.SparkBatchLinkedNodeCondition) DistributionModuleGroup(org.talend.hadoop.distribution.DistributionModuleGroup) HashSet(java.util.HashSet)

Example 13 with SparkBatchLinkedNodeCondition

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

the class DBR550SparkBatchAzureNodeModuleGroup method getModuleGroups.

public static Set<DistributionModuleGroup> getModuleGroups(String distribution, String version) {
    Set<DistributionModuleGroup> hs = new HashSet<>();
    DistributionModuleGroup dmg = new DistributionModuleGroup(DBR550Constant.SPARK_AZURE_MRREQUIRED_MODULE_GROUP.getModuleName(), true, new SparkBatchLinkedNodeCondition(distribution, version, SparkBatchConstant.SPARK_BATCH_AZURE_SPARKCONFIGURATION_LINKEDPARAMETER).getCondition());
    hs.add(dmg);
    return hs;
}
Also used : SparkBatchLinkedNodeCondition(org.talend.hadoop.distribution.condition.common.SparkBatchLinkedNodeCondition) DistributionModuleGroup(org.talend.hadoop.distribution.DistributionModuleGroup) HashSet(java.util.HashSet)

Example 14 with SparkBatchLinkedNodeCondition

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

the class EMR5290SparkBatchSqlRowHiveNodeModuleGroup method getModuleGroups.

public static Set<DistributionModuleGroup> getModuleGroups(String distribution, String version) {
    Set<DistributionModuleGroup> hs = new HashSet<>();
    DistributionModuleGroup dmg = new DistributionModuleGroup(EMR5290Constant.SPARK_HIVE_MRREQUIRED_MODULE_GROUP.getModuleName(), true, (ComponentCondition) new MultiComponentCondition(new SparkBatchLinkedNodeCondition(distribution, version).getCondition(), BooleanOperator.AND, new BasicExpression("SQL_CONTEXT", EqualityOperator.EQ, "HiveContext")));
    hs.add(dmg);
    return hs;
}
Also used : BasicExpression(org.talend.hadoop.distribution.condition.BasicExpression) SparkBatchLinkedNodeCondition(org.talend.hadoop.distribution.condition.common.SparkBatchLinkedNodeCondition) MultiComponentCondition(org.talend.hadoop.distribution.condition.MultiComponentCondition) DistributionModuleGroup(org.talend.hadoop.distribution.DistributionModuleGroup) HashSet(java.util.HashSet)

Example 15 with SparkBatchLinkedNodeCondition

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

the class ModuleGroupsUtilsTest method getModuleGroupsTest_withAdditionCondition.

@Test
public void getModuleGroupsTest_withAdditionCondition() {
    String conditon = "A == 'true'";
    Set<DistributionModuleGroup> groups = ModuleGroupsUtils.getModuleGroups(distribution, version, conditon, groupName, true);
    assertEquals(groups.size(), 1);
    DistributionModuleGroup dmg = groups.iterator().next();
    SparkBatchLinkedNodeCondition underlyingCondition = new SparkBatchLinkedNodeCondition(distribution, version);
    assertEquals(dmg.getModuleName(), groupName);
    assertEquals(dmg.getRequiredIf().getConditionString(), "(" + conditon + ") AND " + underlyingCondition.getCondition().getConditionString());
}
Also used : SparkBatchLinkedNodeCondition(org.talend.hadoop.distribution.condition.common.SparkBatchLinkedNodeCondition) DistributionModuleGroup(org.talend.hadoop.distribution.DistributionModuleGroup) Test(org.junit.Test)

Aggregations

SparkBatchLinkedNodeCondition (org.talend.hadoop.distribution.condition.common.SparkBatchLinkedNodeCondition)15 DistributionModuleGroup (org.talend.hadoop.distribution.DistributionModuleGroup)14 HashSet (java.util.HashSet)13 DynamicPluginAdapter (org.talend.hadoop.distribution.dynamic.adapter.DynamicPluginAdapter)5 MultiComponentCondition (org.talend.hadoop.distribution.condition.MultiComponentCondition)3 Test (org.junit.Test)2 BasicExpression (org.talend.hadoop.distribution.condition.BasicExpression)2 ComponentCondition (org.talend.hadoop.distribution.condition.ComponentCondition)2 SimpleComponentCondition (org.talend.hadoop.distribution.condition.SimpleComponentCondition)2 HashMap (java.util.HashMap)1 Set (java.util.Set)1 HDFSLinkedNodeCondition (org.talend.hadoop.distribution.condition.common.HDFSLinkedNodeCondition)1 SparkStreamingLinkedNodeCondition (org.talend.hadoop.distribution.condition.common.SparkStreamingLinkedNodeCondition)1