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?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to