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

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

                Author: ASF GitHub Bot
            Created on: 07/Oct/19 23:46
            Start Date: 07/Oct/19 23:46
    Worklog Time Spent: 10m 
      Work Description: jcamachor commented on pull request #794: HIVE-21884
URL: https://github.com/apache/hive/pull/794#discussion_r332260987
 
 

 ##########
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/schq/MetastoreBasedScheduledQueryService.java
 ##########
 @@ -0,0 +1,64 @@
+package org.apache.hadoop.hive.ql.schq;
+
+import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
+import org.apache.hadoop.hive.metastore.IMetaStoreClient;
+import org.apache.hadoop.hive.metastore.api.MetaException;
+import org.apache.hadoop.hive.metastore.api.ScheduledQueryPollRequest;
+import org.apache.hadoop.hive.metastore.api.ScheduledQueryPollResponse;
+import org.apache.hadoop.hive.metastore.api.ScheduledQueryProgressInfo;
+import org.apache.hadoop.hive.ql.metadata.Hive;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MetastoreBasedScheduledQueryService implements 
IScheduledQueryMaintenanceService {
+
+  private static final Logger LOG = 
LoggerFactory.getLogger(MetastoreBasedScheduledQueryService.class);
+  private HiveConf conf;
+
+  public MetastoreBasedScheduledQueryService(HiveConf conf) {
+    this.conf = conf;
+  }
+
+  @Override
+  public ScheduledQueryPollResponse scheduledQueryPoll() {
+    try {
+      ScheduledQueryPollRequest request = new ScheduledQueryPollRequest();
+      request.setClusterNamespace(getClusterNamespace());
+      ScheduledQueryPollResponse resp = getMSC().scheduledQueryPoll(request);
+      return resp;
+    } catch (Exception e) {
+      logException("Exception while polling scheduled queries", e);
+      return null;
+    }
+  }
+
+  @Override
+  public void scheduledQueryProgress(ScheduledQueryProgressInfo info) {
+    try {
+      getMSC().scheduledQueryProgress(info);
+    } catch (Exception e) {
+      logException("Exception while updating scheduled execution status of: " 
+ info.getScheduledExecutionId(), e);
+    }
+  }
+
+  private IMetaStoreClient getMSC() throws MetaException, HiveException {
+    return Hive.get(conf).getMSC();
+  }
+
+  static void logException(String msg, Exception e) {
+    if (LOG.isDebugEnabled()) {
 
 Review comment:
   This does not seem intuitive... Let's log it as error? Is it expected in any 
case to get an exception over here?
 
----------------------------------------------------------------
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:
us...@infra.apache.org


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

    Worklog Id:     (was: 324715)
    Time Spent: 1h 40m  (was: 1.5h)

> Scheduled query support
> -----------------------
>
>                 Key: HIVE-21884
>                 URL: https://issues.apache.org/jira/browse/HIVE-21884
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Zoltan Haindrich
>            Assignee: Zoltan Haindrich
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-21844.04.patch, HIVE-21844.05.patch, 
> HIVE-21844.06.patch, HIVE-21844.07.patch, HIVE-21844.08.patch, 
> HIVE-21844.09.patch, HIVE-21844.15.patch, HIVE-21844.19.patch, 
> HIVE-21884.01.patch, HIVE-21884.02.patch, HIVE-21884.03.patch, 
> HIVE-21884.09.patch, HIVE-21884.10.patch, HIVE-21884.10.patch, 
> HIVE-21884.11.patch, HIVE-21884.12.patch, HIVE-21884.13.patch, 
> HIVE-21884.14.patch, HIVE-21884.14.patch, HIVE-21884.14.patch, 
> HIVE-21884.16.patch, HIVE-21884.17.patch, HIVE-21884.18.patch, 
> HIVE-21884.20.patch, Scheduled queries2.pdf
>
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> design document:
> https://docs.google.com/document/d/1mJSFdJi_1cbxJTXC9QvGw2rQ3zzJkNfxOO6b5esmyCE/edit#
> in case the google doc is not reachable:  [^Scheduled queries2.pdf] 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to