use of org.apache.ambari.api.model.ApiConfigFile in project components 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())) {
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;
}
use of org.apache.ambari.api.model.ApiConfigFile in project components by Talend.
the class HadoopAmbariClusterService method init.
private void init(List<String> blacklistParams) {
confs = new HashMap<>();
for (ApiConfigFile file : configFiles) {
String type = file.getType();
if (!type.endsWith(SUPPORT_FILE)) {
continue;
}
Configuration conf = new Configuration(false);
Map<String, String> properties = file.getProperties();
for (String key : properties.keySet()) {
if (blacklistParams != null && blacklistParams.contains(key)) {
continue;
}
conf.set(key, properties.get(key));
}
confs.put(type, conf);
}
}
use of org.apache.ambari.api.model.ApiConfigFile in project tbd-studio-se by Talend.
the class HadoopAmbariCluster method getConfigFiles.
private List<ApiConfigFile> getConfigFiles(Map<String, String> actualConfigFilesVersion) {
List<ApiConfigFile> configFiles = new ArrayList<>();
for (String type : actualConfigFilesVersion.keySet()) {
String version = actualConfigFilesVersion.get(type);
ApiConfigFileList2 configFile = cluster.getConfigsResource().readConfig(type, version);
configFiles.addAll(configFile.getFiles());
}
return configFiles;
}
use of org.apache.ambari.api.model.ApiConfigFile 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;
}
use of org.apache.ambari.api.model.ApiConfigFile in project components by Talend.
the class HadoopAmbariCluster method getConfigFiles.
private List<ApiConfigFile> getConfigFiles(Map<String, String> actualConfigFilesVersion) {
List<ApiConfigFile> configFiles = new ArrayList<>();
for (String type : actualConfigFilesVersion.keySet()) {
String version = actualConfigFilesVersion.get(type);
ApiConfigFileList2 configFile = cluster.getConfigsResource().readConfig(type, version);
configFiles.addAll(configFile.getFiles());
}
return configFiles;
}
Aggregations