milleruntime commented on a change in pull request #1572: Refactor use of ServerConfigurationFactory URL: https://github.com/apache/accumulo/pull/1572#discussion_r399547294
########## File path: server/base/src/main/java/org/apache/accumulo/server/ServerContext.java ########## @@ -112,7 +125,26 @@ public synchronized ServerConfigurationFactory getServerConfFactory() { @Override public AccumuloConfiguration getConfiguration() { - return getServerConfFactory().getSystemConfiguration(); + if (systemConfig == null) { + ZooCache propCache = new ZooCache(getZooKeepers(), getZooKeepersSessionTimeOut()); + systemConfig = new ZooConfiguration(this, propCache, getSiteConfiguration()); + } + return systemConfig; + } + + public TableConfiguration getTableConfiguration(TableId id) { + return getServerConfFactory().getTableConfiguration(id); + } + + public NamespaceConfiguration getNamespaceConfiguration(NamespaceId namespaceId) { + return getServerConfFactory().getNamespaceConfiguration(namespaceId); + } + + public DefaultConfiguration getDefaultConfiguration() { + if (defaultConfig == null) { + defaultConfig = DefaultConfiguration.getInstance(); + } + return defaultConfig; Review comment: Yeah and since it anything loading the class will use it, I think it could just be created once during class load as a static variable. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services