@Test void testRoleConfigsWithSingleVolume() { HostgroupView hostGroup = hostGroupWithVolumeCount(1); assertEquals(List.of( config("schema.registry.jar.storage.directory.path", "/hadoopfs/fs1/schema_registry")), subject.getRoleConfigs(SCHEMA_REGISTRY_SERVER, hostGroup, getTemplatePreparationObject(hostGroup)) ); }
@Override public List<ApiClusterTemplateConfig> getRoleConfigs(String roleType, HostgroupView hostGroupView, TemplatePreparationObject source) { CdhVersionForStreaming cdhVersionForStreaming = KafkaConfigProviderUtils.getCdhVersionForStreaming(source); if (cdhVersionForStreaming.supportsCloudJarStorage()) { return List.of( config(CONFIG_JAR_STORAGE_DIRECTORY_PATH, "/schema-registry"), config(CONFIG_JAR_STORAGE_TYPE, "hdfs")); } else { Integer volumeCount = Objects.nonNull(hostGroupView) && hostGroupView.getVolumeCount() > 0 ? 1 : 0; String localPath = buildVolumePathStringZeroVolumeHandled(volumeCount, "schema_registry"); return List.of( config(CONFIG_JAR_STORAGE_DIRECTORY_PATH, localPath)); } }
SchemaRegistryJarStorageConfigProvider implements CmHostGroupRoleConfigProvider { @Override public List<ApiClusterTemplateConfig> getRoleConfigs(String roleType, HostgroupView hostGroupView, TemplatePreparationObject source) { CdhVersionForStreaming cdhVersionForStreaming = KafkaConfigProviderUtils.getCdhVersionForStreaming(source); if (cdhVersionForStreaming.supportsCloudJarStorage()) { return List.of( config(CONFIG_JAR_STORAGE_DIRECTORY_PATH, "/schema-registry"), config(CONFIG_JAR_STORAGE_TYPE, "hdfs")); } else { Integer volumeCount = Objects.nonNull(hostGroupView) && hostGroupView.getVolumeCount() > 0 ? 1 : 0; String localPath = buildVolumePathStringZeroVolumeHandled(volumeCount, "schema_registry"); return List.of( config(CONFIG_JAR_STORAGE_DIRECTORY_PATH, localPath)); } } }
SchemaRegistryJarStorageConfigProvider implements CmHostGroupRoleConfigProvider { @Override public List<ApiClusterTemplateConfig> getRoleConfigs(String roleType, HostgroupView hostGroupView, TemplatePreparationObject source) { CdhVersionForStreaming cdhVersionForStreaming = KafkaConfigProviderUtils.getCdhVersionForStreaming(source); if (cdhVersionForStreaming.supportsCloudJarStorage()) { return List.of( config(CONFIG_JAR_STORAGE_DIRECTORY_PATH, "/schema-registry"), config(CONFIG_JAR_STORAGE_TYPE, "hdfs")); } else { Integer volumeCount = Objects.nonNull(hostGroupView) && hostGroupView.getVolumeCount() > 0 ? 1 : 0; String localPath = buildVolumePathStringZeroVolumeHandled(volumeCount, "schema_registry"); return List.of( config(CONFIG_JAR_STORAGE_DIRECTORY_PATH, localPath)); } }  }
SchemaRegistryJarStorageConfigProvider implements CmHostGroupRoleConfigProvider { @Override public List<ApiClusterTemplateConfig> getRoleConfigs(String roleType, HostgroupView hostGroupView, TemplatePreparationObject source) { CdhVersionForStreaming cdhVersionForStreaming = KafkaConfigProviderUtils.getCdhVersionForStreaming(source); if (cdhVersionForStreaming.supportsCloudJarStorage()) { return List.of( config(CONFIG_JAR_STORAGE_DIRECTORY_PATH, "/schema-registry"), config(CONFIG_JAR_STORAGE_TYPE, "hdfs")); } else { Integer volumeCount = Objects.nonNull(hostGroupView) && hostGroupView.getVolumeCount() > 0 ? 1 : 0; String localPath = buildVolumePathStringZeroVolumeHandled(volumeCount, "schema_registry"); return List.of( config(CONFIG_JAR_STORAGE_DIRECTORY_PATH, localPath)); } }  @Override List<ApiClusterTemplateConfig> getRoleConfigs(String roleType, HostgroupView hostGroupView, TemplatePreparationObject source); @Override String getServiceType(); @Override Set<String> getRoleTypes(); @Override boolean sharedRoleType(String roleType); }
SchemaRegistryJarStorageConfigProvider implements CmHostGroupRoleConfigProvider { @Override public List<ApiClusterTemplateConfig> getRoleConfigs(String roleType, HostgroupView hostGroupView, TemplatePreparationObject source) { CdhVersionForStreaming cdhVersionForStreaming = KafkaConfigProviderUtils.getCdhVersionForStreaming(source); if (cdhVersionForStreaming.supportsCloudJarStorage()) { return List.of( config(CONFIG_JAR_STORAGE_DIRECTORY_PATH, "/schema-registry"), config(CONFIG_JAR_STORAGE_TYPE, "hdfs")); } else { Integer volumeCount = Objects.nonNull(hostGroupView) && hostGroupView.getVolumeCount() > 0 ? 1 : 0; String localPath = buildVolumePathStringZeroVolumeHandled(volumeCount, "schema_registry"); return List.of( config(CONFIG_JAR_STORAGE_DIRECTORY_PATH, localPath)); } }  @Override List<ApiClusterTemplateConfig> getRoleConfigs(String roleType, HostgroupView hostGroupView, TemplatePreparationObject source); @Override String getServiceType(); @Override Set<String> getRoleTypes(); @Override boolean sharedRoleType(String roleType); static final String CONFIG_JAR_STORAGE_DIRECTORY_PATH; static final String CONFIG_JAR_STORAGE_TYPE; }