use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.
the class HbaseCloudStorageServiceConfigProviderTest method testIsConfigurationNeededWhenAttachedCluster.
@Test
public void testIsConfigurationNeededWhenAttachedCluster() {
TemplatePreparationObject preparationObject = getTemplatePreparationObject(true, false);
String inputJson = getBlueprintText("input/clouderamanager.bp");
CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
boolean configurationNeeded = testIsConfigurationNeeded(preparationObject, cmTemplateProcessor);
assertTrue(configurationNeeded);
}
use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.
the class HbaseCloudStorageServiceConfigProviderTest method testGetHbaseServiceConfigsWhenNoStorageConfiguredWithAttachedCluster.
@Test
public void testGetHbaseServiceConfigsWhenNoStorageConfiguredWithAttachedCluster() {
TemplatePreparationObject preparationObject = getTemplatePreparationObject(false, false);
String inputJson = getBlueprintText("input/clouderamanager.bp");
CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject);
assertEquals(0, serviceConfigs.size());
}
use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.
the class HbaseCloudStorageServiceConfigProviderTest method testConfigurationNotNeededWhenDataLake721.
@Test
public void testConfigurationNotNeededWhenDataLake721() {
TemplatePreparationObject preparationObject = getTemplatePreparationObject(true, true, "7.2.1");
String inputJson = getBlueprintText("input/clouderamanager.bp");
CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
boolean configurationNeeded = testIsConfigurationNeeded(preparationObject, cmTemplateProcessor);
assertFalse(configurationNeeded);
}
use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.
the class HbaseCloudStorageServiceConfigProviderTest method testGetHbaseStorageServiceConfigsWhenDataLake721.
@Test
public void testGetHbaseStorageServiceConfigsWhenDataLake721() {
TemplatePreparationObject preparationObject = getTemplatePreparationObject(true, true, "7.2.1");
String inputJson = getBlueprintText("input/clouderamanager.bp");
CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject);
assertEquals(1, serviceConfigs.size());
assertEquals("hdfs_rootdir", serviceConfigs.get(0).getName());
assertEquals("s3a://bucket/cluster1/hbase", serviceConfigs.get(0).getValue());
}
use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.
the class RangerRazDatahubConfigProvider method getAdditionalServices.
@Override
public Map<String, ApiClusterTemplateService> getAdditionalServices(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source) {
if (isConfigurationNeeded(cmTemplateProcessor, source)) {
ApiClusterTemplateService coreSettings = createTemplate();
Set<HostgroupView> hostgroupViews = source.getHostgroupViews();
Map<String, Set<ServiceComponent>> serviceComponentsByHostGroup = cmTemplateProcessor.getServiceComponentsByHostGroup();
Set<String> zkServerGroups = collectZKServers(serviceComponentsByHostGroup);
boolean weHaveMoreThan2ZKServer = getZKHostNumbers(hostgroupViews, zkServerGroups);
return hostgroupViews.stream().filter(hg -> isProperHostGroupForRaz(hg, zkServerGroups, weHaveMoreThan2ZKServer)).collect(Collectors.toMap(HostgroupView::getName, v -> coreSettings));
}
return Map.of();
}
Aggregations