Search in sources :

Example 16 with HadoopComponent

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

the class HDInsight40DistributionTest method testHDInsight40Distribution.

@Test
public void testHDInsight40Distribution() throws Exception {
    HadoopComponent distribution = new HDInsight40Distribution();
    assertNotNull(distribution.getDistributionName());
    assertNotNull(distribution.getVersionName(null));
    assertFalse(distribution.doSupportS3());
    assertEquals(HDInsight40Distribution.DISTRIBUTION_NAME, distribution.getDistribution());
    assertEquals(HDInsight40Distribution.VERSION, distribution.getVersion());
    assertEquals(EHadoopVersion.HADOOP_3, distribution.getHadoopVersion());
    assertFalse(distribution.doSupportKerberos());
    assertFalse(distribution.doSupportUseDatanodeHostname());
    assertFalse(distribution.doSupportGroup());
    assertFalse(distribution.doSupportOldImportMode());
    assertFalse(distribution instanceof HDFSComponent);
    assertEquals(DEFAULT_YARN_APPLICATION_CLASSPATH, ((MRComponent) distribution).getYarnApplicationClasspath());
    assertFalse(distribution instanceof HBaseComponent);
    assertFalse(distribution instanceof SqoopComponent);
    // Spark Batch
    assertTrue(((SparkBatchComponent) distribution).getSparkVersions().contains(ESparkVersion.SPARK_2_4_X));
    assertTrue(((SparkBatchComponent) distribution).getSparkVersions().contains(ESparkVersion.SPARK_2_3_X));
    assertFalse(((SparkBatchComponent) distribution).getSparkVersions().contains(ESparkVersion.SPARK_2_1));
    assertFalse(((SparkBatchComponent) distribution).getSparkVersions().contains(ESparkVersion.SPARK_2_0));
    assertFalse(((SparkBatchComponent) distribution).getSparkVersions().contains(ESparkVersion.SPARK_1_6));
    assertFalse(((SparkBatchComponent) distribution).getSparkVersions().contains(ESparkVersion.SPARK_1_5));
    assertFalse(((SparkBatchComponent) distribution).getSparkVersions().contains(ESparkVersion.SPARK_1_4));
    assertFalse(((SparkBatchComponent) distribution).getSparkVersions().contains(ESparkVersion.SPARK_1_3));
    assertFalse(((SparkBatchComponent) distribution).doSupportDynamicMemoryAllocation());
    assertFalse(((SparkBatchComponent) distribution).isExecutedThroughSparkJobServer());
    assertTrue(((SparkBatchComponent) distribution).isExecutedThroughLivy());
    assertFalse(((SparkBatchComponent) distribution).doSupportSparkStandaloneMode());
    assertFalse(((SparkBatchComponent) distribution).doSupportSparkYarnClientMode());
    assertTrue(((SparkBatchComponent) distribution).doSupportSparkYarnClusterMode());
    // Spark Streaming
    assertTrue(((SparkStreamingComponent) distribution).getSparkVersions().contains(ESparkVersion.SPARK_2_4_X));
    assertFalse(((SparkStreamingComponent) distribution).getSparkVersions().contains(ESparkVersion.SPARK_2_1));
    assertTrue(((SparkStreamingComponent) distribution).getSparkVersions().contains(ESparkVersion.SPARK_2_3_X));
    assertFalse(((SparkStreamingComponent) distribution).getSparkVersions().contains(ESparkVersion.SPARK_2_0));
    assertFalse(((SparkStreamingComponent) distribution).getSparkVersions().contains(ESparkVersion.SPARK_1_6));
    assertFalse(((SparkStreamingComponent) distribution).getSparkVersions().contains(ESparkVersion.SPARK_1_5));
    assertFalse(((SparkStreamingComponent) distribution).getSparkVersions().contains(ESparkVersion.SPARK_1_4));
    assertFalse(((SparkStreamingComponent) distribution).getSparkVersions().contains(ESparkVersion.SPARK_1_3));
    assertFalse(((SparkStreamingComponent) distribution).doSupportDynamicMemoryAllocation());
    assertFalse(((SparkStreamingComponent) distribution).isExecutedThroughSparkJobServer());
    assertTrue(((SparkStreamingComponent) distribution).isExecutedThroughLivy());
    assertFalse(((SparkStreamingComponent) distribution).doSupportCheckpointing());
    assertFalse(((SparkStreamingComponent) distribution).doSupportSparkStandaloneMode());
    assertFalse(((SparkStreamingComponent) distribution).doSupportSparkYarnClientMode());
    assertTrue(((SparkStreamingComponent) distribution).doSupportSparkYarnClusterMode());
    assertFalse(((SparkStreamingComponent) distribution).doSupportBackpressure());
    // Hive
    assertFalse(((HiveComponent) distribution).doSupportHive1());
    assertTrue(((HiveComponent) distribution).doSupportHive2());
    assertTrue(((HiveComponent) distribution).doSupportTezForHive());
    assertFalse(((HiveComponent) distribution).doSupportHBaseForHive());
    assertFalse(((HiveComponent) distribution).doSupportSSL());
    assertTrue(((HiveComponent) distribution).doSupportORCFormat());
    assertTrue(((HiveComponent) distribution).doSupportAvroFormat());
    assertTrue(((HiveComponent) distribution).doSupportParquetFormat());
    assertFalse(((HiveComponent) distribution).doSupportStoreAsParquet());
    assertFalse(distribution instanceof HCatalogComponent);
    assertFalse(distribution instanceof ImpalaComponent);
    assertTrue(distribution.doSupportHDFSEncryption());
    assertTrue(distribution.doSupportCreateServiceConnection());
    assertTrue((distribution.getNecessaryServiceName() == null ? 0 : distribution.getNecessaryServiceName().size()) == 0);
}
Also used : ImpalaComponent(org.talend.hadoop.distribution.component.ImpalaComponent) SparkBatchComponent(org.talend.hadoop.distribution.component.SparkBatchComponent) HDInsight40Distribution(org.talend.hadoop.distribution.hdinsight400.HDInsight40Distribution) HDFSComponent(org.talend.hadoop.distribution.component.HDFSComponent) HadoopComponent(org.talend.hadoop.distribution.component.HadoopComponent) SparkStreamingComponent(org.talend.hadoop.distribution.component.SparkStreamingComponent) HCatalogComponent(org.talend.hadoop.distribution.component.HCatalogComponent) SqoopComponent(org.talend.hadoop.distribution.component.SqoopComponent) HBaseComponent(org.talend.hadoop.distribution.component.HBaseComponent) Test(org.junit.Test) AbstractDistributionTest(org.talend.hadoop.distribution.test.AbstractDistributionTest)

Example 17 with HadoopComponent

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

the class SynapseDistributionTest method testSynapseDistribution.

@Test
public void testSynapseDistribution() throws Exception {
    HadoopComponent distribution = new SynapseDistribution();
    assertNotNull(distribution.getDistributionName());
    assertNotNull(distribution.getVersionName(null));
    assertFalse(distribution.doSupportS3());
    assertEquals(SynapseDistribution.DISTRIBUTION_NAME, distribution.getDistribution());
    assertEquals(SynapseDistribution.VERSION, distribution.getVersion());
    assertEquals(EHadoopVersion.HADOOP_3, distribution.getHadoopVersion());
    assertFalse(distribution.doSupportKerberos());
    assertTrue(distribution.doSupportUseDatanodeHostname());
    assertFalse(distribution.doSupportGroup());
    assertFalse(distribution.doSupportOldImportMode());
    assertFalse(((MRComponent) distribution).isExecutedThroughWebHCat());
    assertFalse(((MRComponent) distribution).doSupportCrossPlatformSubmission());
    assertFalse(((MRComponent) distribution).doSupportImpersonation());
    assertEquals(((MRComponent) distribution).getYarnApplicationClasspath(), YARN_APPLICATION_CLASSPATH);
    assertFalse(distribution instanceof HBaseComponent);
    assertFalse(distribution instanceof SqoopComponent);
    assertFalse(distribution instanceof HCatalogComponent);
    assertFalse(distribution instanceof ImpalaComponent);
    assertTrue(distribution.doSupportAzureDataLakeStorageGen2());
    assertTrue(distribution.doSupportWebHDFS());
}
Also used : ImpalaComponent(org.talend.hadoop.distribution.component.ImpalaComponent) SynapseDistribution(org.talend.hadoop.distribution.synapse.SynapseDistribution) HadoopComponent(org.talend.hadoop.distribution.component.HadoopComponent) HCatalogComponent(org.talend.hadoop.distribution.component.HCatalogComponent) SqoopComponent(org.talend.hadoop.distribution.component.SqoopComponent) HBaseComponent(org.talend.hadoop.distribution.component.HBaseComponent) Test(org.junit.Test)

Example 18 with HadoopComponent

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

the class DistributionHelperTest method test_doSupportService_HadoopComponent.

@Test
public void test_doSupportService_HadoopComponent() {
    HadoopComponent hadoopComponent = Mockito.mock(HadoopComponent.class);
    DistributionBean distribution = Mockito.mock(DistributionBean.class);
    Assert.assertTrue(DistributionHelper.doSupportService(new DistributionVersion(hadoopComponent, distribution, "ABC_10", "Abc 1.0"), IHDConstants.SERVICE_HADOOP));
    // because the SparkComponent is sub class of HadoopComponent
    SparkComponent sparkComponent = Mockito.mock(SparkComponent.class);
    Assert.assertTrue(DistributionHelper.doSupportService(new DistributionVersion(sparkComponent, distribution, "ABC_10", "Abc 1.0"), IHDConstants.SERVICE_HADOOP));
}
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) DistributionBean(org.talend.hadoop.distribution.model.DistributionBean) Test(org.junit.Test)

Example 19 with HadoopComponent

use of org.talend.hadoop.distribution.component.HadoopComponent 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)

Example 20 with HadoopComponent

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

the class AbstractTest4DefaultConfiguration method testDefaultConfiguration_Existed.

// @Test
public void testDefaultConfiguration_Existed() throws JSONException {
    HadoopComponent hadoopComponent = getHadoopComponent();
    final String distribution = hadoopComponent.getDistribution();
    String version = hadoopComponent.getVersion();
    if (version == null) {
        version = "";
    }
    String notFoundMessages = MessageFormat.format("The default configuration of the version \"{0}\" for \"{1}\" is not found", version, distribution);
    // get all
    String wholeConfig = hadoopComponent.getDefaultConfig(distribution, "");
    assertNotNull(notFoundMessages, wholeConfig);
    JSONObject wholeJson = new JSONObject(wholeConfig);
    // should existed one key at least.
    assertTrue(notFoundMessages, wholeJson.length() > 0);
}
Also used : JSONObject(org.talend.utils.json.JSONObject) HadoopComponent(org.talend.hadoop.distribution.component.HadoopComponent)

Aggregations

HadoopComponent (org.talend.hadoop.distribution.component.HadoopComponent)20 Test (org.junit.Test)10 DistributionBean (org.talend.hadoop.distribution.model.DistributionBean)6 DistributionVersion (org.talend.hadoop.distribution.model.DistributionVersion)5 HCatalogComponent (org.talend.hadoop.distribution.component.HCatalogComponent)4 ImpalaComponent (org.talend.hadoop.distribution.component.ImpalaComponent)4 SparkBatchComponent (org.talend.hadoop.distribution.component.SparkBatchComponent)4 SparkStreamingComponent (org.talend.hadoop.distribution.component.SparkStreamingComponent)4 IHDistributionVersion (org.talend.core.runtime.hd.IHDistributionVersion)3 HBaseComponent (org.talend.hadoop.distribution.component.HBaseComponent)3 SparkComponent (org.talend.hadoop.distribution.component.SparkComponent)3 SqoopComponent (org.talend.hadoop.distribution.component.SqoopComponent)3 Before (org.junit.Before)2 BundleContext (org.osgi.framework.BundleContext)2 InvalidSyntaxException (org.osgi.framework.InvalidSyntaxException)2 AbstractDynamicDistributionTemplate (org.talend.hadoop.distribution.dynamic.template.AbstractDynamicDistributionTemplate)2 DynamicDistributionVersion (org.talend.hadoop.distribution.model.DynamicDistributionVersion)2 AbstractDistributionTest (org.talend.hadoop.distribution.test.AbstractDistributionTest)2 HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1