hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (Jira)" <>
Subject [jira] [Work logged] (HIVE-23266) Remove QueryWrapper from ObjectStore
Date Thu, 11 Jun 2020 23:10:00 GMT


ASF GitHub Bot logged work on HIVE-23266:

                Author: ASF GitHub Bot
            Created on: 11/Jun/20 23:09
            Start Date: 11/Jun/20 23:09
    Worklog Time Spent: 10m 
      Work Description: dengzhhu653 commented on a change in pull request #1078:

File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/
@@ -7109,22 +7121,37 @@ protected String describeResult() {
-  public List<HiveObjectPrivilege> listPrincipalDBGrantsAll(
-      String principalName, PrincipalType principalType) {
-    try (QueryWrapper queryWrapper = new QueryWrapper()) {
-      return convertDB(listPrincipalAllDBGrant(principalName, principalType, queryWrapper));
+  public List<HiveObjectPrivilege> listPrincipalDBGrantsAll(String principalName, PrincipalType
principalType) {
+    List<HiveObjectPrivilege> results = Collections.emptyList();
+    try {
+      openTransaction();
+      results = convertDB(listPrincipalAllDBGrant(principalName, principalType));
+      commitTransaction();
+    } catch (Exception e) {
+      throw new RuntimeException(e);
+    } finally {
+      rollbackAndCleanup(true, null);

Review comment:
       I found that using ```try (QueryWrapper wrapper = new QueryWrapper())``` does not need
to add a catch clause comparing to ```try(Query q = pm.newQuery(....))```. 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:

Issue Time Tracking

    Worklog Id:     (was: 444618)
    Time Spent: 2h 20m  (was: 2h 10m)

> Remove QueryWrapper from ObjectStore
> ------------------------------------
>                 Key: HIVE-23266
>                 URL:
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: David Mollitor
>            Assignee: David Mollitor
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-23266.1.patch, HIVE-23266.10.patch, HIVE-23266.11.patch, HIVE-23266.2.patch,
HIVE-23266.2.patch, HIVE-23266.3.patch, HIVE-23266.4.patch, HIVE-23266.5.patch, HIVE-23266.6.patch,
HIVE-23266.7.patch, HIVE-23266.8.patch, HIVE-23266.9.patch
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
> There is currently a utility called {{QueryWrapper}} that makes a normal {{Query}} auto-closable.
 However, {{Query}} is now in fact already auto-closing, so there is no need for this class.
 In trying to remove it, I realized that this wrapper was being passed around in pretty convoluted
ways and also it was sometimes being created in a {{try-with-resources}} block but then never
actually used in any way.
> Remove the {{QueryWrapper}} from the class and simplify some of the DB interactions.

This message was sent by Atlassian Jira

View raw message