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

The following examples show how to use org.apache.hadoop.hive.metastore.HiveMetaHookLoader. These examples are extracted from open source projects. 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
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
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
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
@Override
public IMetaStoreClient createMetaStoreClient(
    HiveConf conf,
    HiveMetaHookLoader hookLoader
) throws MetaException {
  AWSCatalogMetastoreClient client = new AWSCatalogMetastoreClient(conf, hookLoader);
  return client;
}
 
Example 5
@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 Project: pxf   Source File: HiveClientWrapper.java    License: 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
public SentryHiveMetaStoreClient(HiveConf conf, HiveMetaHookLoader hookLoader)
    throws MetaException {
  super(conf, hookLoader);
}