ctubbsii commented on a change in pull request #1572: Refactor use of 
ServerConfigurationFactory
URL: https://github.com/apache/accumulo/pull/1572#discussion_r399542219
 
 

 ##########
 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:
   The class is documented as a singleton... but that appears to have stopped 
being the case as of 37f900b7550d6ffe7b39f2ff5cd766912ab09141 ; it should be a 
singleton. It doesn't need to do all the synchronization that the commit 
cleaned up, but it should still save and reuse the single instance.

----------------------------------------------------------------
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

Reply via email to