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

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

                Author: ASF GitHub Bot
            Created on: 06/May/22 06:03
            Start Date: 06/May/22 06:03
    Worklog Time Spent: 10m 
      Work Description: rbalamohan commented on code in PR #2950:
URL: https://github.com/apache/hive/pull/2950#discussion_r866512745


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -1624,6 +1632,49 @@ public void alter_database(final String dbName, final 
Database newDB) throws TEx
     }
   }
 
+  private boolean isAlterReplSpecific(Database oldDb, Database newDb) {
+    Map<String, String> oldDbProp = oldDb.getParameters();
+    Map<String, String> newDbProp = newDb.getParameters();
+    List<String> replDbProps = 
Arrays.stream(ReplConst.class.getDeclaredFields())
+            .filter(field -> Modifier.isStatic(field.getModifiers()))
+            .map(field -> {
+              try {
+                String prop = (String) field.get(String.class);
+                return prop.replace("\"", "");
+              } catch (IllegalAccessException e) {
+                throw new RuntimeException(e);
+              }
+            }).collect(Collectors.toList());
+    boolean replSpecific = false;
+    if (newDbProp != null) {
+      for (Map.Entry<String, String> prop : newDbProp.entrySet()) {
+        String propName = prop.getKey().replace("\"", "");
+        String oldValue = (oldDbProp == null) ? null : 
oldDbProp.get(prop.getKey());
+        if (!prop.getValue().equals(oldValue)) {
+          if (propName.startsWith(ReplConst.BOOTSTRAP_DUMP_STATE_KEY_PREFIX) 
|| replDbProps.contains(propName)) {
+            replSpecific = true;
+          } else {
+            return false;
+          }
+        }
+      }
+    }
+    if (oldDbProp != null) {
+      for (Map.Entry<String, String> prop : oldDbProp.entrySet()) {
+        String propName = prop.getKey().replace("\"", "");

Review Comment:
   take out this codepath to separate method for reuse?





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

    Worklog Id:     (was: 767027)
    Time Spent: 40m  (was: 0.5h)

> Skip tracking of alterDatabase events for replication specific properties.
> --------------------------------------------------------------------------
>
>                 Key: HIVE-25872
>                 URL: https://issues.apache.org/jira/browse/HIVE-25872
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Haymant Mangla
>            Assignee: Haymant Mangla
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to