rdblue commented on a change in pull request #187: Catalog Implementation for
hive and hadoop.
URL: https://github.com/apache/incubator-iceberg/pull/187#discussion_r284914543
##########
File path: hive/src/main/java/org/apache/iceberg/hive/HiveCatalog.java
##########
@@ -0,0 +1,79 @@
+package org.apache.iceberg.hive;
+
+import java.io.IOException;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.metastore.HiveMetaStoreClient;
+import org.apache.hadoop.hive.metastore.api.Table;
+import org.apache.iceberg.BaseMetastoreCatalog;
+import org.apache.iceberg.BaseTable;
+import org.apache.iceberg.TableOperations;
+import org.apache.iceberg.catalog.TableIdentifier;
+import org.apache.thrift.TException;
+
+import static
org.apache.iceberg.BaseMetastoreTableOperations.METADATA_LOCATION_PROP;
+
+public class HiveCatalog extends BaseMetastoreCatalog {
+
+ private final HiveClientPool clients;
+ private final Configuration conf;
+
+ public HiveCatalog(Configuration conf) {
+ super(conf);
+ this.conf = conf;
+ this.clients = new HiveClientPool(2, conf);
+ }
+
+ @Override
+ public void dropTable(TableIdentifier tableIdentifier) {
+ validateTableIdentifier(tableIdentifier);
+ HiveMetaStoreClient hiveMetaStoreClient = this.clients.newClient();
Review comment:
That's correct. `newClient` is protected so that subclasses can provide an
implementation, not so that other classes in this package can call it. The
correct way to do this is to use `run`. That handles reconnections and uses the
client pool. `get` is also private.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]