use of org.apache.accumulo.server.conf.ZooConfiguration in project accumulo by apache.
the class ServerContext method getConfiguration.
@Override
public AccumuloConfiguration getConfiguration() {
if (systemConfig == null) {
// system configuration uses its own instance of ZooCache
// this could be useful to keep its update counter independent
ZooCache propCache = new ZooCache(new ZooReader(getZooKeepers(), getZooKeepersSessionTimeOut()), null);
systemConfig = new ZooConfiguration(this, propCache, getSiteConfiguration());
}
return systemConfig;
}
use of org.apache.accumulo.server.conf.ZooConfiguration in project accumulo by apache.
the class Upgrader9to10 method renameOldMasterPropsinZK.
@SuppressWarnings("deprecation")
private void renameOldMasterPropsinZK(ServerContext context) {
// Rename all of the properties only set in ZooKeeper that start with "master." to rename and
// store them starting with "manager." instead.
var zooConfiguration = new ZooConfiguration(context, context.getZooCache(), new ConfigurationCopy());
zooConfiguration.getAllPropertiesWithPrefix(Property.MASTER_PREFIX).forEach((original, value) -> {
DeprecatedPropertyUtil.getReplacementName(original, (log, replacement) -> {
log.info("Automatically renaming deprecated property '{}' with its replacement '{}'" + " in ZooKeeper on upgrade.", original, replacement);
try {
// Set the property under the new name
SystemPropUtil.setSystemProperty(context, replacement, value);
SystemPropUtil.removePropWithoutDeprecationWarning(context, original);
} catch (KeeperException | InterruptedException e) {
throw new RuntimeException("Unable to upgrade system properties", e);
}
});
});
}
Aggregations