private void dropDatabaseCascadePerTable(DropDatabaseRequest req, List<String> tableList, int maxBatchSize)
      throws TException {
    for (Table table : new TableIterable(
        this, req.getCatalogName(), req.getName(), tableList, maxBatchSize)) {
      boolean success = false;
      HiveMetaHook hook = getHook(table);
      try {
        if (hook != null) {
          hook.preDropTable(table);
        }
        boolean isSoftDelete = req.isSoftDelete() && Boolean.parseBoolean(
          table.getParameters().get(SOFT_DELETE_TABLE));
        EnvironmentContext context = null;
        if (req.isSetTxnId()) {
          context = new EnvironmentContext();
          context.putToProperties(hive_metastoreConstants.TXN_ID, String.valueOf(req.getTxnId()));
          req.setDeleteManagedDir(false);
        }
        DropTableRequest dropTableReq = new DropTableRequest(req.getName(), table.getTableName());
        dropTableReq.setDeleteData(req.isDeleteData() && !isSoftDelete);
        dropTableReq.setCatalogName(req.getCatalogName());
        dropTableReq.setDropPartitions(true);
        dropTableReq.setEnvContext(context);
        client.drop_table_req(dropTableReq);
        if (hook != null) {
          hook.commitDropTable(table, req.isDeleteData());
        }
        success = true;
      } finally {
        if (!success && hook != null) {
          hook.rollbackDropTable(table);
        }
      }
    }
    client.drop_database_req(req);
  }
Handles dropDatabase by invoking drop_table in HMS for each table.
Useful when table list in DB is too large to fit in memory. It will retrieve tables in
chunks and for each table with a drop_table hook it will invoke drop_table on both HMS and
the hook. This is a timely operation so hookless tables are skipped and will be dropped on
server side when the client invokes drop_database.
Note that this is 'less transactional' than dropDatabaseCascadePerDb since we're dropping
table level objects, so the overall outcome of this method might result in a halfly dropped DB.
@param tableList
@param maxBatchSize
@throws TException
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java