org.apache.hadoop.hive.metastore.HiveMetaHookLoader Java Examples

The following examples show how to use org.apache.hadoop.hive.metastore.HiveMetaHookLoader. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HiveMetaStoreClientFactory.java    From incubator-gobblin with Apache License 2.0 7 votes vote down vote up
private IMetaStoreClient createMetaStoreClient() throws MetaException {
  HiveMetaHookLoader hookLoader = new HiveMetaHookLoader() {
    @Override
    public HiveMetaHook getHook(Table tbl) throws MetaException {
      if (tbl == null) {
        return null;
      }

      try {
        HiveStorageHandler storageHandler =
            HiveUtils.getStorageHandler(hiveConf, tbl.getParameters().get(META_TABLE_STORAGE));
        return storageHandler == null ? null : storageHandler.getMetaHook();
      } catch (HiveException e) {
        LOG.error(e.toString());
        throw new MetaException("Failed to get storage handler: " + e);
      }
    }
  };

  return RetryingMetaStoreClient.getProxy(hiveConf, hookLoader, HiveMetaStoreClient.class.getName());
}
 
Example #2
Source File: AWSCatalogMetastoreClient.java    From aws-glue-data-catalog-client-for-apache-hive-metastore with Apache License 2.0 6 votes vote down vote up
public AWSCatalogMetastoreClient(HiveConf conf, HiveMetaHookLoader hook) throws MetaException {
  this.conf = conf;
  glueClient = new AWSGlueClientFactory(this.conf).newClient();

  // TODO preserve existing functionality for HiveMetaHook
  wh = new Warehouse(this.conf);

  AWSGlueMetastore glueMetastore = new AWSGlueMetastoreFactory().newMetastore(conf);
  glueMetastoreClientDelegate = new GlueMetastoreClientDelegate(this.conf, glueMetastore, wh);

  snapshotActiveConf();
  catalogId = MetastoreClientUtils.getCatalogId(conf);
  if (!doesDefaultDBExist()) {
    createDefaultDatabase();
  }
}
 
Example #3
Source File: AWSCatalogMetastoreClient.java    From aws-glue-data-catalog-client-for-apache-hive-metastore with Apache License 2.0 6 votes vote down vote up
public AWSCatalogMetastoreClient(HiveConf conf, HiveMetaHookLoader hook) throws MetaException {
  this.conf = conf;
  glueClient = new AWSGlueClientFactory(this.conf).newClient();

  // TODO preserve existing functionality for HiveMetaHook
  wh = new Warehouse(this.conf);

  AWSGlueMetastore glueMetastore = new AWSGlueMetastoreFactory().newMetastore(conf);
  glueMetastoreClientDelegate = new GlueMetastoreClientDelegate(this.conf, glueMetastore, wh);

  snapshotActiveConf();
  catalogId = MetastoreClientUtils.getCatalogId(conf);
  if (!doesDefaultDBExist()) {
    createDefaultDatabase();
  }
}
 
Example #4
Source File: AWSGlueDataCatalogHiveClientFactory.java    From aws-glue-data-catalog-client-for-apache-hive-metastore with Apache License 2.0 5 votes vote down vote up
@Override
public IMetaStoreClient createMetaStoreClient(
    HiveConf conf,
    HiveMetaHookLoader hookLoader
) throws MetaException {
  AWSCatalogMetastoreClient client = new AWSCatalogMetastoreClient(conf, hookLoader);
  return client;
}
 
Example #5
Source File: AWSGlueDataCatalogHiveClientFactory.java    From aws-glue-data-catalog-client-for-apache-hive-metastore with Apache License 2.0 5 votes vote down vote up
@Override
public IMetaStoreClient createMetaStoreClient(
    HiveConf conf, HiveMetaHookLoader hookLoader,
    boolean allowEmbedded,
    ConcurrentHashMap<String, Long> concurrentHashMap
) throws MetaException {
  AWSCatalogMetastoreClient client = new AWSCatalogMetastoreClient(conf, hookLoader);
  return client;
}
 
Example #6
Source File: HiveClientWrapper.java    From pxf with Apache License 2.0 4 votes vote down vote up
IMetaStoreClient initHiveClient(HiveConf hiveConf) throws MetaException {
    return RetryingMetaStoreClient.getProxy(hiveConf, new Class[]{HiveConf.class, HiveMetaHookLoader.class, Boolean.class},
            new Object[]{hiveConf, null, true}, null, HiveMetaStoreClientCompatibility1xx.class.getName()
    );
}
 
Example #7
Source File: SentryHiveMetaStoreClient.java    From incubator-sentry with Apache License 2.0 4 votes vote down vote up
public SentryHiveMetaStoreClient(HiveConf conf, HiveMetaHookLoader hookLoader)
    throws MetaException {
  super(conf, hookLoader);
}