Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
FANNG1 committed Oct 18, 2024
1 parent 135b3cd commit 8ef9409
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ public class IcebergConstants {
public static final String ICEBERG_REST_CATALOG_CACHE_EVICTION_INTERVAL =
"catalog-cache-eviction-interval-ms";

public static final String ICEBERG_REST_CATALOG_PROVIDER = "catalog-provider";
public static final String ICEBERG_REST_CATALOG_CONFIG_PROVIDER = "catalog-config-provider";
public static final String STATIC_ICEBERG_CATALOG_CONFIG_PROVIDER_NAME = "static-config-provider";
public static final String DYNAMIC_ICEBERG_CATALOG_CONFIG_PROVIDER_NAME =
"dynamic-config-provider";

public static final String GRAVITINO_URI = "gravitino-uri";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,13 @@ public class IcebergConfig extends Config implements OverwriteDefaultConfig {
.longConf()
.createWithDefault(3600000L);

public static final ConfigEntry<String> ICEBERG_REST_CATALOG_PROVIDER =
new ConfigBuilder(IcebergConstants.ICEBERG_REST_CATALOG_PROVIDER)
public static final ConfigEntry<String> ICEBERG_REST_CATALOG_CONFIG_PROVIDER =
new ConfigBuilder(IcebergConstants.ICEBERG_REST_CATALOG_CONFIG_PROVIDER)
.doc(
"Catalog provider class name, you can develop a class that implements `IcebergCatalogWrapperProvider` and add the corresponding jar file to the Iceberg REST service classpath directory.")
"Catalog provider class name, you can develop a class that implements `IcebergCatalogConfigProvider` and add the corresponding jar file to the Iceberg REST service classpath directory.")
.version(ConfigConstants.VERSION_0_7_0)
.stringConf()
.createWithDefault("config-based-provider");
.createWithDefault(IcebergConstants.STATIC_ICEBERG_CATALOG_CONFIG_PROVIDER_NAME);

public static final ConfigEntry<String> GRAVITINO_URI =
new ConfigBuilder(IcebergConstants.GRAVITINO_URI)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ public class DynamicIcebergCatalogConfigProvider
public static final Logger LOG =
LoggerFactory.getLogger(DynamicIcebergCatalogConfigProvider.class);

public static final String DYNAMIC_ICEBERG_CATALOG_CONFIG_PROVIDER_NAME =
"dynamic-config-provider";

private String gravitinoMetalake;

private GravitinoAdminClient client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ public class StaticIcebergCatalogConfigProvider implements IcebergCatalogConfigP
public static final Logger LOG =
LoggerFactory.getLogger(StaticIcebergCatalogConfigProvider.class);

public static final String STATIC_ICEBERG_CATALOG_CONFIG_PROVIDER_NAME = "static-config-provider";

@VisibleForTesting Map<String, IcebergConfig> catalogConfigs;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ public class IcebergCatalogWrapperManager implements AutoCloseable {

private static final ImmutableMap<String, String> ICEBERG_CATALOG_CONFIG_PROVIDER_NAMES =
ImmutableMap.of(
StaticIcebergCatalogConfigProvider.STATIC_ICEBERG_CATALOG_CONFIG_PROVIDER_NAME,
IcebergConstants.STATIC_ICEBERG_CATALOG_CONFIG_PROVIDER_NAME,
StaticIcebergCatalogConfigProvider.class.getCanonicalName(),
DynamicIcebergCatalogConfigProvider.DYNAMIC_ICEBERG_CATALOG_CONFIG_PROVIDER_NAME,
IcebergConstants.DYNAMIC_ICEBERG_CATALOG_CONFIG_PROVIDER_NAME,
DynamicIcebergCatalogConfigProvider.class.getCanonicalName());

private final Cache<String, IcebergCatalogWrapper> icebergCatalogWrapperCache;
Expand All @@ -60,7 +60,7 @@ public class IcebergCatalogWrapperManager implements AutoCloseable {

public IcebergCatalogWrapperManager(Map<String, String> properties) {
this.credentialProviderManager = new CredentialProviderManager();
this.provider = createProvider(properties);
this.provider = createIcebergCatalogConfigProvider(properties);
this.provider.initialize(properties);
this.icebergCatalogWrapperCache =
Caffeine.newBuilder()
Expand Down Expand Up @@ -139,9 +139,10 @@ private String getCatalogName(String rawPrefix) {
return prefix;
}

private IcebergCatalogConfigProvider createProvider(Map<String, String> properties) {
private IcebergCatalogConfigProvider createIcebergCatalogConfigProvider(
Map<String, String> properties) {
String providerName =
(new IcebergConfig(properties)).get(IcebergConfig.ICEBERG_REST_CATALOG_PROVIDER);
(new IcebergConfig(properties)).get(IcebergConfig.ICEBERG_REST_CATALOG_CONFIG_PROVIDER);
String className =
ICEBERG_CATALOG_CONFIG_PROVIDER_NAMES.getOrDefault(providerName, providerName);
LOG.info("Load Iceberg catalog provider: {}.", className);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static ResourceConfig getIcebergResourceConfig(Class c, boolean bindIcebe
Map<String, String> catalogConf = Maps.newHashMap();
String catalogConfigPrefix = "catalog." + PREFIX;
catalogConf.put(
IcebergConstants.ICEBERG_REST_CATALOG_PROVIDER,
IcebergConstants.ICEBERG_REST_CATALOG_CONFIG_PROVIDER,
StaticIcebergCatalogConfigProvider.class.getName());
catalogConf.put(String.format("%s.catalog-backend-name", catalogConfigPrefix), PREFIX);
catalogConf.put(
Expand Down

0 comments on commit 8ef9409

Please sign in to comment.