hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (Jira)" <j...@apache.org>
Subject [jira] [Work logged] (HIVE-23351) Ranger Replication Scheduling
Date Fri, 08 May 2020 14:29:00 GMT

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

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

                Author: ASF GitHub Bot
            Created on: 08/May/20 14:28
            Start Date: 08/May/20 14:28
    Worklog Time Spent: 10m 
      Work Description: pkumarsinha commented on a change in pull request #1004:
URL: https://github.com/apache/hive/pull/1004#discussion_r422175531



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplLoadTask.java
##########
@@ -103,13 +105,43 @@ public int execute() {
     }
     work.setRootTask(this);
     this.parentTasks = null;
+    if (shouldLoadAuthorizationMetadata()) {
+      LOG.info("Loading authorization data");
+      try {
+        initiateAuthorizationLoadTask(work.dumpDirectory);
+      } catch (Exception e) {
+        LOG.error("failed", e);
+        setException(e);
+        return ErrorMsg.getErrorMsg(e.getMessage()).getErrorCode();
+      }
+    }
     if (work.isIncrementalLoad()) {
       return executeIncrementalLoad();
     } else {
       return executeBootStrapLoad();
     }
   }
 
+  private boolean shouldLoadAuthorizationMetadata() {
+    return conf.getBoolVar(HiveConf.ConfVars.REPL_INCLUDE_AUTHORIZATION_METADATA);
+  }
+
+  private void initiateAuthorizationLoadTask(String hiveDumpDirectory) throws SemanticException
{
+    if (RANGER_AUTHORIZER.equalsIgnoreCase(conf.getVar(HiveConf.ConfVars.REPL_AUTHORIZATION_PROVIDER_SERVICE)))
{
+      Path rangerLoadRoot = new Path(new Path(hiveDumpDirectory).getParent(), ReplUtils.REPL_RANGER_BASE_DIR);
+      LOG.info("Importing Authorization Metadata from {} ", rangerLoadRoot);
+      RangerLoadWork rangerLoadWork = new RangerLoadWork(rangerLoadRoot, work.getSourceDbName(),
work.dbNameToLoadIn);
+      Task<RangerLoadWork> rangerLoadTask = TaskFactory.get(rangerLoadWork, conf);
+      if (childTasks == null) {
+        childTasks = new ArrayList<>();
+      }
+      childTasks.add(rangerLoadTask);

Review comment:
       Metadata will run as a part of current task.
   if (work.isIncrementalLoad()) {
         return executeIncrementalLoad();
       } else {
         return executeBootStrapLoad();
       }
   in either bootstrap or in incremental, this will run it as part of current ReplLoadTask




----------------------------------------------------------------
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:
users@infra.apache.org


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

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

> Ranger Replication Scheduling
> -----------------------------
>
>                 Key: HIVE-23351
>                 URL: https://issues.apache.org/jira/browse/HIVE-23351
>             Project: Hive
>          Issue Type: Task
>            Reporter: Aasha Medhi
>            Assignee: Aasha Medhi
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-23351.01.patch, HIVE-23351.02.patch, HIVE-23351.03.patch, HIVE-23351.04.patch,
HIVE-23351.05.patch, HIVE-23351.06.patch
>
>          Time Spent: 2h 10m
>  Remaining Estimate: 0h
>




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

Mime
View raw message