/** * @return The names of all databases in the MetaStore. */ public HiveDatabases getHiveDatabases() throws Exception { final HiveDatabases databases = HiveDatabases.newInstance( executeSecure(metaStoreClient::getAllDatabases), securityContext, getPrincipals(), getKeytabs()); LOG.debug("Hive databases {}", databases.list()); return databases; }
/** * @return The table names for the database specified in the parameter */ public Tables getHiveTables(String dbName) throws MetaException, PrivilegedActionException, IOException, InterruptedException { final Tables tables = Tables.newInstance(executeSecure(() -> metaStoreClient.getAllTables(dbName)), securityContext, false, getPrincipals(), getKeytabs()); LOG.debug("Hive database [{}] has tables {}", dbName, tables.getTables()); return tables; }