use of org.talend.hadoop.distribution.condition.ComponentCondition in project tbd-studio-se by Talend.
the class ModuleGroupsUtils method getStreamingModuleGroups.
/**
* Utility method to create the collection of {@link DistributionModuleGroup} with a condition made of a
* {@link SparkStreamingLinkedNodeCondition} and an additional raw condition
*
* @param distribution the distribution key
* @param version the version key
* @param condition a nullable additional condition
* @param moduleName the module name
* @param mrRequired if the module group is mrRequired
* @return a set of {@link DistributionModuleGroup}
*/
public static Set<DistributionModuleGroup> getStreamingModuleGroups(String distribution, String version, ComponentCondition condition, String moduleName, boolean mrRequired) {
Set<DistributionModuleGroup> hs = new HashSet<>();
ComponentCondition distribCondition = new SparkStreamingLinkedNodeCondition(distribution, version).getCondition();
ComponentCondition cc = null;
if (condition != null) {
cc = new MultiComponentCondition(condition, BooleanOperator.AND, distribCondition);
} else {
cc = distribCondition;
}
DistributionModuleGroup dmg = new DistributionModuleGroup(moduleName, mrRequired, cc);
hs.add(dmg);
return hs;
}
use of org.talend.hadoop.distribution.condition.ComponentCondition in project tbd-studio-se by Talend.
the class DynamicSqoopModuleGroup method getModuleGroups.
@Override
public Set<DistributionModuleGroup> getModuleGroups() throws Exception {
Set<DistributionModuleGroup> hs = new HashSet<>();
DynamicPluginAdapter pluginAdapter = getPluginAdapter();
String sqoopRuntimeId = pluginAdapter.getRuntimeModuleGroupIdByTemplateId(DynamicModuleGroupConstant.SQOOP_MODULE_GROUP.getModuleName());
String sqoopParquetRuntimeId = pluginAdapter.getRuntimeModuleGroupIdByTemplateId(DynamicModuleGroupConstant.SQOOP_PARQUET_MODULE_GROUP.getModuleName());
String sqoopHiveRuntimeId = pluginAdapter.getRuntimeModuleGroupIdByTemplateId(DynamicModuleGroupConstant.SQOOP_HIVE_MODULE_GROUP.getModuleName());
checkRuntimeId(sqoopRuntimeId);
checkRuntimeId(sqoopParquetRuntimeId);
checkRuntimeId(sqoopHiveRuntimeId);
if (StringUtils.isNotBlank(sqoopRuntimeId)) {
hs.add(new DistributionModuleGroup(sqoopRuntimeId));
}
if (StringUtils.isNotBlank(sqoopParquetRuntimeId)) {
ComponentCondition parquetOutputCondition = new SimpleComponentCondition(new BasicExpression(SqoopConstant.FILE_FORMAT, EqualityOperator.EQ, SqoopConstant.PAQUET_OUTPUT_FORMAT));
hs.add(new DistributionModuleGroup(sqoopParquetRuntimeId, true, parquetOutputCondition));
}
if (StringUtils.isNotBlank(sqoopHiveRuntimeId)) {
ComponentCondition hiveOutputCondition = new SimpleComponentCondition(new RawExpression("ADDITIONAL_JAVA CONTAINS {ADDITIONAL_ARGUMENT=\"hive.import\", ADDITIONAL_VALUE=\"true\"}"));
hs.add(new DistributionModuleGroup(sqoopHiveRuntimeId, true, hiveOutputCondition));
}
return hs;
}
use of org.talend.hadoop.distribution.condition.ComponentCondition 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;
}
use of org.talend.hadoop.distribution.condition.ComponentCondition 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;
}
Aggregations