[
https://issues.apache.org/jira/browse/HIVE-25872?focusedWorklogId=767025&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-767025
]
ASF GitHub Bot logged work on HIVE-25872:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 06/May/22 06:02
Start Date: 06/May/22 06:02
Worklog Time Spent: 10m
Work Description: rbalamohan commented on code in PR #2950:
URL: https://github.com/apache/hive/pull/2950#discussion_r866512386
##########
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;
Review Comment:
Is the intent to replace/skip all REPL related properties? If so, should the
logic be different? As in, why bailing out on first non-repl case?
Issue Time Tracking
-------------------
Worklog Id: (was: 767025)
Time Spent: 0.5h (was: 20m)
> 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: 0.5h
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.7#820007)