You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2019/05/16 00:55:13 UTC

[GitHub] [incubator-iceberg] linxingyuan1102 commented on a change in pull request #187: Catalog Implementation for hive and hadoop.

linxingyuan1102 commented on a change in pull request #187: Catalog Implementation for hive and hadoop.
URL: https://github.com/apache/incubator-iceberg/pull/187#discussion_r284503958
 
 

 ##########
 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:
   Looks like `clients.get()` is a more legitimate method to use here? Alternatively, `clients.run()` can be used here.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org