brianloss commented on a change in pull request #1873:
URL: https://github.com/apache/accumulo/pull/1873#discussion_r561273710



##########
File path: 
server/manager/src/main/java/org/apache/accumulo/master/upgrade/Upgrader9to10.java
##########
@@ -201,6 +204,39 @@ private void upgradeRootTabletMetadata(ServerContext ctx) {
     delete(ctx, ZROOT_TABLET_PATH);
   }
 
+  @SuppressWarnings("removal")
+  @Deprecated(since = "2.1.0", forRemoval = true)
+  private void renameMasterProps(ServerContext ctx) {
+    try {
+      // Figure out which props with the "master." prefix are set only in 
Zookeeper. If
+      // a property exists in the config and is either not set in the site 
config, or has
+      // a different value from the site config, then the property is set in 
zookeeper
+      // and we want to upgrade.
+      HashMap<String,String> configProps = new HashMap<>();
+      HashMap<String,String> siteProps = new HashMap<>();
+      ctx.getConfiguration().getProperties(configProps,
+          p -> 
p.startsWith(DeprecatedPropertyUtil.MasterPropertyRenamer.MASTER_PREFIX));
+      ctx.getSiteConfiguration().getProperties(siteProps,
+          p -> 
p.startsWith(DeprecatedPropertyUtil.MasterPropertyRenamer.MASTER_PREFIX));
+      configProps.entrySet().removeIf(
+          e -> siteProps.containsKey(e.getKey()) && 
e.getValue().equals(siteProps.get(e.getKey())));
+
+      for (Entry<String,String> entry : configProps.entrySet()) {
+        // Set the property under the new name
+        SystemPropUtil.setSystemProperty(ctx,
+            DeprecatedPropertyUtil.renameDeprecatedProperty(entry.getKey(), 
false),

Review comment:
       Sure, good idea. I'll add in the next commit.




----------------------------------------------------------------
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:
[email protected]


Reply via email to