Skip to content

Commit e3681ec

Browse files
author
Jennifer Baldwin
committed
review updates
1 parent 367667c commit e3681ec

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

hive-metastore/src/main/java/org/apache/iceberg/hive/CachedClientPool.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public <R> R run(Action<R, IMetaStoreClient, TException> action, boolean retry)
131131
static Key extractKey(String cacheKeys, Configuration conf) {
132132
// generate key elements in a certain order, so that the Key instances are comparable
133133
List<Object> elements = Lists.newArrayList();
134-
elements.add(conf.get("hive.metastore.uris", ""));
134+
elements.add(conf.get(HiveCatalog.HIVE_METASTORE_URIS, ""));
135135
elements.add(conf.get(HiveCatalog.HIVE_CONF_CATALOG, "hive"));
136136
if (cacheKeys == null || cacheKeys.isEmpty()) {
137137
return Key.of(elements);

hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ public class HiveCatalog extends BaseMetastoreViewCatalog
8181

8282
// MetastoreConf is not available with current Hive version
8383
static final String HIVE_CONF_CATALOG = "metastore.catalog.default";
84+
static final String HIVE_METASTORE_WAREHOUSE_DIR = "hive.metastore.warehouse.dir";
85+
static final String HIVE_METASTORE_URIS = "hive.metastore.uris";
8486

8587
private static final Logger LOG = LoggerFactory.getLogger(HiveCatalog.class);
8688

@@ -103,12 +105,12 @@ public void initialize(String inputName, Map<String, String> properties) {
103105
}
104106

105107
if (properties.containsKey(CatalogProperties.URI)) {
106-
this.conf.set("hive.metastore.uris", properties.get(CatalogProperties.URI));
108+
this.conf.set(HIVE_METASTORE_URIS, properties.get(CatalogProperties.URI));
107109
}
108110

109111
if (properties.containsKey(CatalogProperties.WAREHOUSE_LOCATION)) {
110112
this.conf.set(
111-
"hive.metastore.warehouse.dir",
113+
HIVE_METASTORE_WAREHOUSE_DIR,
112114
LocationUtil.stripTrailingSlash(properties.get(CatalogProperties.WAREHOUSE_LOCATION)));
113115
}
114116

@@ -727,7 +729,7 @@ protected String defaultWarehouseLocation(TableIdentifier tableIdentifier) {
727729
}
728730

729731
private String databaseLocation(String databaseName) {
730-
String warehouseLocation = conf.get("hive.metastore.warehouse.dir");
732+
String warehouseLocation = conf.get(HIVE_METASTORE_WAREHOUSE_DIR);
731733
Preconditions.checkNotNull(
732734
warehouseLocation, "Warehouse location is not set: hive.metastore.warehouse.dir=null");
733735
warehouseLocation = LocationUtil.stripTrailingSlash(warehouseLocation);
@@ -795,7 +797,7 @@ Database convertToDatabase(Namespace namespace, Map<String, String> meta) {
795797
public String toString() {
796798
return MoreObjects.toStringHelper(this)
797799
.add("name", name)
798-
.add("uri", this.conf == null ? "" : this.conf.get("hive.metastore.uris"))
800+
.add("uri", this.conf == null ? "" : this.conf.get(HIVE_METASTORE_URIS))
799801
.toString();
800802
}
801803

0 commit comments

Comments
 (0)