[ 
https://issues.apache.org/jira/browse/HIVE-26443?focusedWorklogId=802417&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-802417
 ]

ASF GitHub Bot logged work on HIVE-26443:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 22/Aug/22 09:49
            Start Date: 22/Aug/22 09:49
    Worklog Time Spent: 10m 
      Work Description: veghlaci05 commented on code in PR #3513:
URL: https://github.com/apache/hive/pull/3513#discussion_r951236348


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java:
##########
@@ -229,17 +231,33 @@ public CompactionInfo 
findNextToCompact(FindNextCompactRequest rqst) throws Meta
       }
 
       Connection dbConn = null;
-      Statement stmt = null;
+      PreparedStatement stmt = null;
       //need a separate stmt for executeUpdate() otherwise it will close the 
ResultSet(HIVE-12725)
       Statement updStmt = null;
       ResultSet rs = null;
+
+      long poolTimeout = MetastoreConf.getTimeVar(conf, 
ConfVars.COMPACTOR_WORKER_POOL_TIMEOUT, TimeUnit.MILLISECONDS);
+
       try {
         dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED, 
connPoolCompaction);
-        stmt = dbConn.createStatement();
-        String query = "SELECT \"CQ_ID\", \"CQ_DATABASE\", \"CQ_TABLE\", 
\"CQ_PARTITION\", " +
-          "\"CQ_TYPE\", \"CQ_TBLPROPERTIES\" FROM \"COMPACTION_QUEUE\" WHERE 
\"CQ_STATE\" = '" + INITIATED_STATE + "'";
+        StringBuilder sb = new StringBuilder();
+        sb.append("SELECT \"CQ_ID\", \"CQ_DATABASE\", \"CQ_TABLE\", 
\"CQ_PARTITION\", " +
+          "\"CQ_TYPE\", \"CQ_POOL_NAME\", \"CQ_TBLPROPERTIES\" FROM 
\"COMPACTION_QUEUE\" WHERE \"CQ_STATE\" = '" + INITIATED_STATE + "' AND ");
+        boolean hasPoolName = 
org.apache.commons.lang3.StringUtils.isNotBlank(rqst.getPoolName());

Review Comment:
   Unfortunately not. 
   `org.apache.hadoop.util.StringUtils` is already imported, and used 23 times. 
It has the `stringifyException(e)` method, which 
org.apache.commons.lang3.StringUtils does not contain. On the other side, it 
doesn't have any methods for string emptiness check. Since both classes are 
required, I decided to fully qualify the lang3 one, since it is used fewer 
times.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 802417)
    Time Spent: 5h 10m  (was: 5h)

> Add priority queueing to compaction
> -----------------------------------
>
>                 Key: HIVE-26443
>                 URL: https://issues.apache.org/jira/browse/HIVE-26443
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: László Végh
>            Assignee: László Végh
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: Pool based compaction queues.docx
>
>          Time Spent: 5h 10m
>  Remaining Estimate: 0h
>
> The details can be found in the attached design doc.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to