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

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

                Author: ASF GitHub Bot
            Created on: 14/Apr/21 12:03
            Start Date: 14/Apr/21 12:03
    Worklog Time Spent: 10m 
      Work Description: aasha commented on a change in pull request #2167:
URL: https://github.com/apache/hive/pull/2167#discussion_r613181869



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/stats/StatsUpdaterThread.java
##########
@@ -226,8 +227,8 @@ private void stopWorkers() {
     //    on the target again
     // 2. updating stats requires a writeId to be created. Hence writeIds on 
source and target
     //    can get out of sync when stats are updated. That can cause 
consistency issues.
-    String replTrgtParam = 
table.getParameters().get(ReplConst.REPL_TARGET_TABLE_PROPERTY);
-    if (replTrgtParam != null && !replTrgtParam.isEmpty()) {
+    HiveMetaStoreClient msc = new HiveMetaStoreClient(conf);
+    if (ReplUtils.isTargetOfReplication(msc.getDatabase(table.getCatName(), 
table.getDbName()))) {

Review comment:
       can use rs directly instead of msc

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/util/ReplUtils.java
##########
@@ -140,7 +140,7 @@
 
   public static final String RANGER_CONFIGURATION_RESOURCE_NAME = 
"ranger-hive-security.xml";
 
-  public static final String TARGET_OF_REPLICATION = "repl.target.for";
+  public static final String TARGET_OF_REPLICATION = 
ReplConst.TARGET_OF_REPLICATION;

Review comment:
       you dont need another constant TARGET_OF_REPLICATION is its already 
defined in ReplConst class

##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/PartitionManagementTask.java
##########
@@ -88,9 +90,13 @@ private static boolean partitionDiscoveryEnabled(Map<String, 
String> params) {
             
params.get(DISCOVER_PARTITIONS_TBLPROPERTY).equalsIgnoreCase("true");
   }
 
-  private static boolean tblBeingReplicatedInto(Map<String, String> params) {
-    return params != null && 
params.containsKey(ReplConst.REPL_TARGET_TABLE_PROPERTY) &&
-            !params.get(ReplConst.REPL_TARGET_TABLE_PROPERTY).trim().isEmpty();
+  public boolean isTargetOfReplication(Database db) {
+    assert (db != null);
+    Map<String, String> m = db.getParameters();

Review comment:
       rename to params

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/stats/StatsUpdaterThread.java
##########
@@ -226,8 +227,8 @@ private void stopWorkers() {
     //    on the target again
     // 2. updating stats requires a writeId to be created. Hence writeIds on 
source and target
     //    can get out of sync when stats are updated. That can cause 
consistency issues.
-    String replTrgtParam = 
table.getParameters().get(ReplConst.REPL_TARGET_TABLE_PROPERTY);
-    if (replTrgtParam != null && !replTrgtParam.isEmpty()) {
+    HiveMetaStoreClient msc = new HiveMetaStoreClient(conf);
+    if (ReplUtils.isTargetOfReplication(msc.getDatabase(table.getCatName(), 
table.getDbName()))) {

Review comment:
       in case of table level replication is anything need to be handled?




-- 
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: 582416)
    Time Spent: 20m  (was: 10m)

> modify condition for target of replication in statsUpdaterThread and 
> PartitionManagementTask
> --------------------------------------------------------------------------------------------
>
>                 Key: HIVE-25002
>                 URL: https://issues.apache.org/jira/browse/HIVE-25002
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Haymant Mangla
>            Assignee: Haymant Mangla
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>




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

Reply via email to