in emr-user-role-mapper-s3storagebasedauthorizationmanager/src/main/java/com/amazonaws/emr/urm/hive/urmstoragebasedauthorizer/S3StorageBasedAuthorizationProvider.java [67:83]
private void initWh() throws MetaException, HiveException, MetaException {
if (wh == null){
if(!isRunFromMetaStore){
// Note, although HiveProxy has a method that allows us to check if we're being
// called from the metastore or from the client, we don't have an initialized HiveProxy
// till we explicitly initialize it as being from the client side. So, we have a
// chicken-and-egg problem. So, we now track whether or not we're running from client-side
// in the SBAP itself.
hive_db = new HiveProxy(Hive.get(getConf(), StorageBasedAuthorizationProvider.class));
this.wh = new Warehouse(getConf());
} else {
// not good if we reach here, this was initialized at setMetaStoreHandler() time.
// this means handler.getWh() is returning null. Error out.
throw new IllegalStateException("Uninitialized Warehouse from MetastoreHandler");
}
}
}