Search in sources :

Example 6 with SparkStreamingComponent

use of org.talend.hadoop.distribution.component.SparkStreamingComponent in project tbd-studio-se by Talend.

the class AbstractDynamicCDPDistributionTemplate method buildModuleGroupsTemplateMap.

@Override
protected Map<ComponentType, IDynamicModuleGroupTemplate> buildModuleGroupsTemplateMap() {
    Map<ComponentType, IDynamicModuleGroupTemplate> groupTemplateMap = super.buildModuleGroupsTemplateMap();
    DynamicPluginAdapter pluginAdapter = getPluginAdapter();
    if (this instanceof HiveOnSparkComponent) {
        groupTemplateMap.put(ComponentType.HIVEONSPARK, new DynamicCDPHiveOnSparkModuleGroupTemplate(pluginAdapter));
    }
    if (this instanceof SparkBatchComponent) {
        groupTemplateMap.put(ComponentType.SPARKBATCH, new DynamicCDPSparkBatchModuleGroupTemplate(pluginAdapter));
    }
    if (this instanceof SparkStreamingComponent) {
        groupTemplateMap.put(ComponentType.SPARKSTREAMING, new DynamicCDPSparkStreamingModuleGroupTemplate(pluginAdapter));
    }
    if (this instanceof SqoopComponent) {
        groupTemplateMap.put(ComponentType.SQOOP, new DynamicCDPSqoopModuleGroupTemplate(pluginAdapter));
    }
    if (this instanceof ImpalaComponent) {
        groupTemplateMap.put(ComponentType.IMPALA, new DynamicImpalaModuleGroupTemplate(pluginAdapter));
    }
    return groupTemplateMap;
}
Also used : ImpalaComponent(org.talend.hadoop.distribution.component.ImpalaComponent) ComponentType(org.talend.hadoop.distribution.ComponentType) DynamicPluginAdapter(org.talend.hadoop.distribution.dynamic.adapter.DynamicPluginAdapter) HiveOnSparkComponent(org.talend.hadoop.distribution.component.HiveOnSparkComponent) DynamicImpalaModuleGroupTemplate(org.talend.hadoop.distribution.dynamic.template.DynamicImpalaModuleGroupTemplate) SparkBatchComponent(org.talend.hadoop.distribution.component.SparkBatchComponent) IDynamicModuleGroupTemplate(org.talend.hadoop.distribution.dynamic.template.IDynamicModuleGroupTemplate) SparkStreamingComponent(org.talend.hadoop.distribution.component.SparkStreamingComponent) SqoopComponent(org.talend.hadoop.distribution.component.SqoopComponent)

Example 7 with SparkStreamingComponent

use of org.talend.hadoop.distribution.component.SparkStreamingComponent in project tbd-studio-se by Talend.

the class AbstractDynamicHDPDistributionTemplate method buildModuleGroupsTemplateMap.

@Override
protected Map<ComponentType, IDynamicModuleGroupTemplate> buildModuleGroupsTemplateMap() {
    Map<ComponentType, IDynamicModuleGroupTemplate> groupTemplateMap = super.buildModuleGroupsTemplateMap();
    DynamicPluginAdapter pluginAdapter = getPluginAdapter();
    if (this instanceof HDFSComponent) {
        groupTemplateMap.put(ComponentType.HDFS, new DynamicHDPHDFSModuleGroupTemplate(pluginAdapter));
    }
    if (this instanceof MRComponent) {
        groupTemplateMap.put(ComponentType.MAPREDUCE, new DynamicHDPMapReduceModuleGroupTemplate(pluginAdapter));
    }
    if (this instanceof SparkBatchComponent) {
        groupTemplateMap.put(ComponentType.SPARKBATCH, new DynamicHDPSparkBatchModuleGroupTemplate(pluginAdapter));
    }
    if (this instanceof SparkStreamingComponent) {
        groupTemplateMap.put(ComponentType.SPARKSTREAMING, new DynamicHDPSparkStreamingModuleGroupTemplate(pluginAdapter));
    }
    if (this instanceof HiveOnSparkComponent) {
        groupTemplateMap.put(ComponentType.HIVEONSPARK, new DynamicHDPHiveOnSparkModuleGroupTemplate(pluginAdapter));
    }
    if (this instanceof SqoopComponent) {
        groupTemplateMap.put(ComponentType.SQOOP, new DynamicHDPSqoopModuleGroupTemplate(pluginAdapter));
    }
    return groupTemplateMap;
}
Also used : ComponentType(org.talend.hadoop.distribution.ComponentType) DynamicPluginAdapter(org.talend.hadoop.distribution.dynamic.adapter.DynamicPluginAdapter) HiveOnSparkComponent(org.talend.hadoop.distribution.component.HiveOnSparkComponent) MRComponent(org.talend.hadoop.distribution.component.MRComponent) SparkBatchComponent(org.talend.hadoop.distribution.component.SparkBatchComponent) HDFSComponent(org.talend.hadoop.distribution.component.HDFSComponent) IDynamicModuleGroupTemplate(org.talend.hadoop.distribution.dynamic.template.IDynamicModuleGroupTemplate) SparkStreamingComponent(org.talend.hadoop.distribution.component.SparkStreamingComponent) SqoopComponent(org.talend.hadoop.distribution.component.SqoopComponent)

Example 8 with SparkStreamingComponent

use of org.talend.hadoop.distribution.component.SparkStreamingComponent in project tbd-studio-se by Talend.

the class DistributionHelperTest method test_doSupportService_SparkComponent.

@Test
public void test_doSupportService_SparkComponent() {
    HadoopComponent hadoopComponent = Mockito.mock(HadoopComponent.class);
    DistributionBean distribution = Mockito.mock(DistributionBean.class);
    Assert.assertFalse(DistributionHelper.doSupportService(new DistributionVersion(hadoopComponent, distribution, "ABC_10", "Abc 1.0"), IHDConstants.SERVICE_SPARK));
    SparkComponent sparkComponent = Mockito.mock(SparkComponent.class);
    Assert.assertTrue(DistributionHelper.doSupportService(new DistributionVersion(sparkComponent, distribution, "ABC_10", "Abc 1.0"), IHDConstants.SERVICE_SPARK));
    // because the SparkStreamingComponent is sub class of SparkComponent
    SparkStreamingComponent sparkStreamingComponent = Mockito.mock(SparkStreamingComponent.class);
    Assert.assertTrue(DistributionHelper.doSupportService(new DistributionVersion(sparkStreamingComponent, distribution, "ABC_10", "Abc 1.0"), IHDConstants.SERVICE_SPARK));
}
Also used : IHDistributionVersion(org.talend.core.runtime.hd.IHDistributionVersion) DistributionVersion(org.talend.hadoop.distribution.model.DistributionVersion) SparkComponent(org.talend.hadoop.distribution.component.SparkComponent) HadoopComponent(org.talend.hadoop.distribution.component.HadoopComponent) SparkStreamingComponent(org.talend.hadoop.distribution.component.SparkStreamingComponent) DistributionBean(org.talend.hadoop.distribution.model.DistributionBean) Test(org.junit.Test)

Aggregations

SparkStreamingComponent (org.talend.hadoop.distribution.component.SparkStreamingComponent)8 SparkBatchComponent (org.talend.hadoop.distribution.component.SparkBatchComponent)6 ImpalaComponent (org.talend.hadoop.distribution.component.ImpalaComponent)5 SqoopComponent (org.talend.hadoop.distribution.component.SqoopComponent)5 Test (org.junit.Test)4 ComponentType (org.talend.hadoop.distribution.ComponentType)4 HadoopComponent (org.talend.hadoop.distribution.component.HadoopComponent)4 HiveOnSparkComponent (org.talend.hadoop.distribution.component.HiveOnSparkComponent)4 DynamicPluginAdapter (org.talend.hadoop.distribution.dynamic.adapter.DynamicPluginAdapter)4 HCatalogComponent (org.talend.hadoop.distribution.component.HCatalogComponent)3 HDFSComponent (org.talend.hadoop.distribution.component.HDFSComponent)3 MRComponent (org.talend.hadoop.distribution.component.MRComponent)3 IDynamicModuleGroupTemplate (org.talend.hadoop.distribution.dynamic.template.IDynamicModuleGroupTemplate)3 IHDistributionVersion (org.talend.core.runtime.hd.IHDistributionVersion)2 HBaseComponent (org.talend.hadoop.distribution.component.HBaseComponent)2 SparkComponent (org.talend.hadoop.distribution.component.SparkComponent)2 DynamicImpalaModuleGroupTemplate (org.talend.hadoop.distribution.dynamic.template.DynamicImpalaModuleGroupTemplate)2 DistributionBean (org.talend.hadoop.distribution.model.DistributionBean)2 DistributionVersion (org.talend.hadoop.distribution.model.DistributionVersion)2 AbstractDistributionTest (org.talend.hadoop.distribution.test.AbstractDistributionTest)2