@Test public void testConfigurationNeededWhenDatalake722() { TemplatePreparationObject preparationObject = getTemplatePreparationObject(true, true, "7.2.2"); String inputJson = getBlueprintText("input/clouderamanager.bp"); CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson); boolean configurationNeeded = underTest.isConfigurationNeeded(cmTemplateProcessor, preparationObject); assertTrue(configurationNeeded); }
@Override public boolean isConfigurationNeeded(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source) { boolean datalakeCluster = source.getSharedServiceConfigs() .map(SharedServiceConfigsView::isDatalakeCluster) .orElse(false); String cdhVersion = getCdhVersion(source); boolean is722OrNewer = isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_2_2); String actorCrn = INTERNAL_ACTOR_CRN; String accountId = ThreadBasedUserCrnProvider.getAccountId(); boolean sdxHbaseCloudStorageEnabled = entitlementService.sdxHbaseCloudStorageEnabled(actorCrn, accountId); return source.getFileSystemConfigurationView().isPresent() && cmTemplateProcessor.isRoleTypePresentInService(getServiceType(), getRoleTypes()) && (!datalakeCluster || (is722OrNewer && sdxHbaseCloudStorageEnabled)); }
HbaseCloudStorageServiceConfigProvider implements CmTemplateComponentConfigProvider { @Override public boolean isConfigurationNeeded(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source) { boolean datalakeCluster = source.getSharedServiceConfigs() .map(SharedServiceConfigsView::isDatalakeCluster) .orElse(false); String cdhVersion = getCdhVersion(source); boolean is722OrNewer = isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_2_2); String actorCrn = INTERNAL_ACTOR_CRN; String accountId = ThreadBasedUserCrnProvider.getAccountId(); boolean sdxHbaseCloudStorageEnabled = entitlementService.sdxHbaseCloudStorageEnabled(actorCrn, accountId); return source.getFileSystemConfigurationView().isPresent() && cmTemplateProcessor.isRoleTypePresentInService(getServiceType(), getRoleTypes()) && (!datalakeCluster || (is722OrNewer && sdxHbaseCloudStorageEnabled)); } }
HbaseCloudStorageServiceConfigProvider implements CmTemplateComponentConfigProvider { @Override public boolean isConfigurationNeeded(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source) { boolean datalakeCluster = source.getSharedServiceConfigs() .map(SharedServiceConfigsView::isDatalakeCluster) .orElse(false); String cdhVersion = getCdhVersion(source); boolean is722OrNewer = isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_2_2); String actorCrn = INTERNAL_ACTOR_CRN; String accountId = ThreadBasedUserCrnProvider.getAccountId(); boolean sdxHbaseCloudStorageEnabled = entitlementService.sdxHbaseCloudStorageEnabled(actorCrn, accountId); return source.getFileSystemConfigurationView().isPresent() && cmTemplateProcessor.isRoleTypePresentInService(getServiceType(), getRoleTypes()) && (!datalakeCluster || (is722OrNewer && sdxHbaseCloudStorageEnabled)); }  }
HbaseCloudStorageServiceConfigProvider implements CmTemplateComponentConfigProvider { @Override public boolean isConfigurationNeeded(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source) { boolean datalakeCluster = source.getSharedServiceConfigs() .map(SharedServiceConfigsView::isDatalakeCluster) .orElse(false); String cdhVersion = getCdhVersion(source); boolean is722OrNewer = isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_2_2); String actorCrn = INTERNAL_ACTOR_CRN; String accountId = ThreadBasedUserCrnProvider.getAccountId(); boolean sdxHbaseCloudStorageEnabled = entitlementService.sdxHbaseCloudStorageEnabled(actorCrn, accountId); return source.getFileSystemConfigurationView().isPresent() && cmTemplateProcessor.isRoleTypePresentInService(getServiceType(), getRoleTypes()) && (!datalakeCluster || (is722OrNewer && sdxHbaseCloudStorageEnabled)); }  @Override List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source); @Override String getServiceType(); @Override List<String> getRoleTypes(); @Override boolean isConfigurationNeeded(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source); }
HbaseCloudStorageServiceConfigProvider implements CmTemplateComponentConfigProvider { @Override public boolean isConfigurationNeeded(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source) { boolean datalakeCluster = source.getSharedServiceConfigs() .map(SharedServiceConfigsView::isDatalakeCluster) .orElse(false); String cdhVersion = getCdhVersion(source); boolean is722OrNewer = isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_2_2); String actorCrn = INTERNAL_ACTOR_CRN; String accountId = ThreadBasedUserCrnProvider.getAccountId(); boolean sdxHbaseCloudStorageEnabled = entitlementService.sdxHbaseCloudStorageEnabled(actorCrn, accountId); return source.getFileSystemConfigurationView().isPresent() && cmTemplateProcessor.isRoleTypePresentInService(getServiceType(), getRoleTypes()) && (!datalakeCluster || (is722OrNewer && sdxHbaseCloudStorageEnabled)); }  @Override List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source); @Override String getServiceType(); @Override List<String> getRoleTypes(); @Override boolean isConfigurationNeeded(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source);  }