brianloss commented on a change in pull request #1873:
URL: https://github.com/apache/accumulo/pull/1873#discussion_r561272860
##########
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())));
Review comment:
I was trying to list only properties that are set in ZK. I couldn't find
a better way to determine that, and modeled this after code in
[ConfigCommand](https://github.com/apache/accumulo/blob/main/shell/src/main/java/org/apache/accumulo/shell/commands/ConfigCommand.java).
In the case you mention, the ZK property is superfluous and really should be
removed rather than renamed if it matches what's in site already, but I'm not
doing that either.
Is there another utility for retrieving ZK properties while ignoring the
contents of the site file, command-line and env properties? Maybe I need to
write something if not.
----------------------------------------------------------------
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]