private List<Table> getRemoteTableObjectsInternal(String dbname, List<String> tableNames, String pattern) throws MetaException {
    String[] parsedDbName = parseDbName(dbname, conf);
    try {
      // retrieve tables from remote database
      Database db = get_database_core(parsedDbName[CAT_NAME], parsedDbName[DB_NAME]);
      List<Table> tables = DataConnectorProviderFactory.getDataConnectorProvider(db).getTables(null);

      // filtered out undesired tables
      if (tableNames != null) {
        tables = filterTablesByName(tables, tableNames);
      }

      // set remote tables' local hive database reference
      for (Table table : tables) {
        table.setDbName(dbname);
      }

      return FilterUtils.filterTablesIfEnabled(isServerFilterEnabled, filterHook, tables);
    } catch (Exception e) {
      LOG.warn("Unexpected exception while getting table(s) in remote database " + dbname , e);
      if (isInTest) {
        // ignore the exception
        return new ArrayList<Table>();
      } else {
        throw newMetaException(e);
      }
    }
  }
Gets multiple tables from the hive metastore.

@param req
         The GetTablesRequest object.
@return A list of tables whose names are in the the list "names" and
        are retrievable from the database specified by "dbnames."
        There is no guarantee of the order of the returned tables.
        If there are duplicate names, only one instance of the table will be returned.
@throws MetaException
@throws InvalidOperationException
@throws UnknownDBException
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java