Skip to content

Commit 81ca073

Browse files
committed
drop database req
1 parent 7a93264 commit 81ca073

File tree

22 files changed

+1235
-323
lines changed

22 files changed

+1235
-323
lines changed

standalone-metastore/metastore-client/src/main/java/org/apache/hadoop/hive/metastore/client/ThriftHiveMetaStoreClient.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,22 @@ public boolean createType(Type type) throws AlreadyExistsException,
15171517

15181518
@Override
15191519
public void dropDatabase(DropDatabaseRequest req) throws TException {
1520-
client.drop_database_req(req);
1520+
req.setAsyncDrop(!isLocalMetaStore());
1521+
AsyncOperationResp resp = client.drop_database_req(req);
1522+
req.setId(resp.getId());
1523+
try {
1524+
while (!resp.isFinished() && !Thread.currentThread().isInterrupted()) {
1525+
resp = client.drop_database_req(req);
1526+
if (resp.getMessage() != null) {
1527+
LOG.info(resp.getMessage());
1528+
}
1529+
}
1530+
} finally {
1531+
if (!resp.isFinished()) {
1532+
req.setCancel(true);
1533+
client.drop_database_req(req);
1534+
}
1535+
}
15211536
}
15221537

15231538
@Override

standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp

Lines changed: 43 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h

Lines changed: 20 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class ThriftHiveMetastoreHandler : virtual public ThriftHiveMetastoreIf {
8585
printf("drop_database\n");
8686
}
8787

88-
void drop_database_req(const DropDatabaseRequest& req) {
88+
void drop_database_req(AsyncOperationResp& _return, const DropDatabaseRequest& req) {
8989
// Your implementation goes here
9090
printf("drop_database_req\n");
9191
}

0 commit comments

Comments
 (0)