@Override public Database get_database(final String name) throws NoSuchObjectException, MetaException { startFunction("get_database", ": " + name); Database db = null; Exception ex = null; try { String[] parsedDbName = parseDbName(name, conf); db = get_database_core(parsedDbName[CAT_NAME], parsedDbName[DB_NAME]); firePreEvent(new PreReadDatabaseEvent(db, this)); } catch (MetaException|NoSuchObjectException e) { ex = e; throw e; } finally { endFunction("get_database", db != null, ex); } return db; }
private void authorizeReadDatabase(PreReadDatabaseEvent context) throws InvalidOperationException, MetaException { if (!isReadAuthzEnabled()) { return; } try { for (HiveMetastoreAuthorizationProvider authorizer : tAuthorizers.get()) { authorizer.authorize(new Database(context.getDatabase()), new Privilege[] { Privilege.SELECT }, null); } } catch (AuthorizationException e) { throw invalidOperationException(e); } catch (HiveException e) { throw metaException(e); } }
@Override public Database get_database(final String name) throws NoSuchObjectException, MetaException { startFunction("get_database", ": " + name); Database db = null; Exception ex = null; try { db = get_database_core(name); firePreEvent(new PreReadDatabaseEvent(db, this)); } catch (MetaException e) { ex = e; throw e; } catch (NoSuchObjectException e) { ex = e; throw e; } finally { endFunction("get_database", db != null, ex); } return db; }
private void authorizeReadDatabase(PreReadDatabaseEvent context) throws InvalidOperationException, MetaException { if (!isReadAuthzEnabled()) { return; } try { for (HiveMetastoreAuthorizationProvider authorizer : tAuthorizers.get()) { authorizer.authorize(new Database(context.getDatabase()), new Privilege[] { Privilege.SELECT }, null); } } catch (AuthorizationException e) { throw invalidOperationException(e); } catch (HiveException e) { throw metaException(e); } }
@Override public Database get_database(final String name) throws NoSuchObjectException, MetaException { startFunction("get_database", ": " + name); Database db = null; Exception ex = null; try { db = get_database_core(name); firePreEvent(new PreReadDatabaseEvent(db, this)); } catch (MetaException e) { ex = e; throw e; } catch (NoSuchObjectException e) { ex = e; throw e; } finally { endFunction("get_database", db != null, ex); } return db; }
private void authorizeReadDatabase(PreReadDatabaseEvent context) throws InvalidOperationException, MetaException { if (!isReadAuthzEnabled()) { return; } try { for (HiveMetastoreAuthorizationProvider authorizer : tAuthorizers.get()) { authorizer.authorize(new Database(context.getDatabase()), new Privilege[] { Privilege.SELECT }, null); } } catch (AuthorizationException e) { throw invalidOperationException(e); } catch (HiveException e) { throw metaException(e); } }
@Override public Database get_database(final String name) throws NoSuchObjectException, MetaException { startFunction("get_database", ": " + name); Database db = null; Exception ex = null; try { String[] parsedDbName = parseDbName(name, conf); db = get_database_core(parsedDbName[CAT_NAME], parsedDbName[DB_NAME]); firePreEvent(new PreReadDatabaseEvent(db, this)); } catch (MetaException|NoSuchObjectException e) { ex = e; throw e; } finally { endFunction("get_database", db != null, ex); } return db; }