Search in sources :

Example 6 with HadoopClusterService

use of org.talend.repository.hadoopcluster.configurator.HadoopClusterService in project tbd-studio-se by Talend.

the class HadoopAmbariCluster method distributeConfigFilesToService.

private Map<HadoopHostedService, HadoopClusterService> distributeConfigFilesToService(String serviceName, List<ApiConfigFile> configs) {
    Map<HadoopHostedService, HadoopClusterService> servicesMapping = new HashMap<HadoopHostedService, HadoopClusterService>();
    HadoopHostedService service = HadoopHostedService.fromString(serviceName);
    if (service == HadoopHostedService.HIVE) {
        ApiConfigFile hcatalogConfig = null;
        for (ApiConfigFile file : configs) {
            if ("webhcat-site".equals(file.getType())) {
                // $NON-NLS-1$
                hcatalogConfig = file;
                break;
            }
        }
        if (hcatalogConfig != null) {
            configs.remove(hcatalogConfig);
            servicesMapping.put(HadoopHostedService.WEBHCAT, new HadoopAmbariClusterService(Arrays.asList(hcatalogConfig), blacklistParams));
        }
    }
    servicesMapping.put(service, new HadoopAmbariClusterService(configs, blacklistParams));
    return servicesMapping;
}
Also used : HadoopHostedService(org.talend.repository.hadoopcluster.configurator.HadoopHostedService) HashMap(java.util.HashMap) HadoopClusterService(org.talend.repository.hadoopcluster.configurator.HadoopClusterService) ApiConfigFile(org.apache.ambari.api.model.ApiConfigFile)

Example 7 with HadoopClusterService

use of org.talend.repository.hadoopcluster.configurator.HadoopClusterService in project tbd-studio-se by Talend.

the class RetrieveRemoteConfsService method getAllServices.

@Override
public List<String> getAllServices() throws Exception {
    List<String> services = new ArrayList<>();
    if (cluster != null) {
        Map<HadoopHostedService, HadoopClusterService> hadoopHostedServices = cluster.getHostedServices();
        Set<HadoopHostedService> hostedServices = hadoopHostedServices.keySet();
        for (HadoopHostedService hostedService : hostedServices) {
            services.add(hostedService.name());
        }
    }
    return services;
}
Also used : HadoopHostedService(org.talend.repository.hadoopcluster.configurator.HadoopHostedService) ArrayList(java.util.ArrayList) HadoopClusterService(org.talend.repository.hadoopcluster.configurator.HadoopClusterService)

Example 8 with HadoopClusterService

use of org.talend.repository.hadoopcluster.configurator.HadoopClusterService in project tbd-studio-se by Talend.

the class RetrieveRemoteConfsService method exportConfs.

@Override
public String exportConfs(List<String> services) throws Exception {
    if (services == null) {
        return null;
    }
    String targetFolderPath = HadoopConfsUtils.getConfsSitesTempFolder();
    Map<HadoopHostedService, HadoopClusterService> hadoopHostedServices = cluster.getHostedServices();
    for (HadoopHostedService serviceName : hadoopHostedServices.keySet()) {
        if (services.contains(serviceName.name())) {
            hadoopHostedServices.get(serviceName).exportConfigurationToXml(targetFolderPath);
        }
    }
    return targetFolderPath;
}
Also used : HadoopHostedService(org.talend.repository.hadoopcluster.configurator.HadoopHostedService) HadoopClusterService(org.talend.repository.hadoopcluster.configurator.HadoopClusterService)

Example 9 with HadoopClusterService

use of org.talend.repository.hadoopcluster.configurator.HadoopClusterService in project tbd-studio-se by Talend.

the class HadoopAmbariCluster method getHostedServices.

/*
     * (non-Javadoc)
     *
     * @see org.talend.repository.hadoopcluster.configurator.HadoopCluster#getHostedServices()
     */
@Override
public Map<HadoopHostedService, HadoopClusterService> getHostedServices() {
    Map<HadoopHostedService, HadoopClusterService> hostedServices = null;
    Map<HadoopHostedService, HadoopClusterService> filteredHostedServices = new HashMap<HadoopHostedService, HadoopClusterService>();
    if (supportSCV) {
        hostedServices = getHostedServicesForNew(allSupportedServices());
    } else {
        hostedServices = getHostedServicesForOld(allSupportedServices());
    }
    // now(metadata wizard and component)
    for (HadoopHostedService serviceName : hostedServices.keySet()) {
        if (hostedServices.get(serviceName).hasConfigurations()) {
            filteredHostedServices.put(serviceName, hostedServices.get(serviceName));
        }
    }
    return filteredHostedServices;
}
Also used : HadoopHostedService(org.talend.repository.hadoopcluster.configurator.HadoopHostedService) HashMap(java.util.HashMap) HadoopClusterService(org.talend.repository.hadoopcluster.configurator.HadoopClusterService)

Example 10 with HadoopClusterService

use of org.talend.repository.hadoopcluster.configurator.HadoopClusterService in project tbd-studio-se by Talend.

the class ClouderaHadoopConfig513Test method testConfigurator_cdh513.

/**
 * there is a cluster at Bonn
 *
 * 192.168.150.98 tal-qa143.talend.lan tal-qa143
 *
 * 192.168.150.99 tal-qa144.talend.lan tal-qa144
 *
 * 192.168.150.77 tal-qa146.talend.lan tal-qa146
 *
 * 192.168.150.78 tal-qa147.talend.lan tal-qa147
 */
// FIXME: use Mock of Cloudera API or TestContainers framework (https://www.testcontainers.org/) to be able to test it.
@Ignore("ignored in buildme system, comment out this line when run locally")
@Test
public void testConfigurator_cdh513() throws Exception {
    String folder = "/tmp/cm";
    // 513
    String url = "https://tal-qa14.talend.lan:7183";
    String trustStoreFile = "cdhcn.truststore";
    String trustStorePwd = "talend";
    String trustStoreType = "jks";
    HadoopConfigurator configurator = TestUtil.getConfigurator(url, trustStoreFile, trustStoreType, trustStorePwd);
    TestUtil.checkCluster(configurator, "Cluster 1");
    HadoopCluster cluster = configurator.getCluster(configurator.getAllClusters().get(0));
    Map<HadoopHostedService, HadoopClusterService> services = cluster.getHostedServices();
    TestUtil.checkService(services, HadoopHostedService.HDFS, HadoopHostedService.YARN, HadoopHostedService.HIVE, HadoopHostedService.HBASE);
    TestUtil.checkServiceConf(services.get(HadoopHostedService.HDFS), "hdfs-site.xml", "core-site.xml");
    TestUtil.checkServiceConf(services.get(HadoopHostedService.YARN), "yarn-site.xml", "hdfs-site.xml", "core-site.xml", "mapred-site.xml");
    TestUtil.checkServiceConf(services.get(HadoopHostedService.HIVE), "hive-site.xml", "yarn-site.xml", "hdfs-site.xml", "core-site.xml", "mapred-site.xml");
    TestUtil.checkServiceConf(services.get(HadoopHostedService.HBASE), "hbase-site.xml", "hdfs-site.xml", "core-site.xml");
}
Also used : HadoopHostedService(org.talend.repository.hadoopcluster.configurator.HadoopHostedService) HadoopConfigurator(org.talend.repository.hadoopcluster.configurator.HadoopConfigurator) HadoopClusterService(org.talend.repository.hadoopcluster.configurator.HadoopClusterService) HadoopCluster(org.talend.repository.hadoopcluster.configurator.HadoopCluster) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

HadoopClusterService (org.talend.repository.hadoopcluster.configurator.HadoopClusterService)10 HadoopHostedService (org.talend.repository.hadoopcluster.configurator.HadoopHostedService)10 HadoopCluster (org.talend.repository.hadoopcluster.configurator.HadoopCluster)4 HadoopConfigurator (org.talend.repository.hadoopcluster.configurator.HadoopConfigurator)4 HashMap (java.util.HashMap)3 Ignore (org.junit.Ignore)3 Test (org.junit.Test)3 URL (java.net.URL)2 HadoopConfiguratorBuilder (org.talend.repository.hadoopcluster.configurator.HadoopConfiguratorBuilder)2 ApiException (com.cloudera.api.swagger.client.ApiException)1 ApiService (com.cloudera.api.swagger.model.ApiService)1 ApiServiceList (com.cloudera.api.swagger.model.ApiServiceList)1 MalformedURLException (java.net.MalformedURLException)1 ArrayList (java.util.ArrayList)1 ApiConfigFile (org.apache.ambari.api.model.ApiConfigFile)1