accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmil...@apache.org
Subject [accumulo] branch master updated: Set props path in ConfigOpts. Fixes #676 (#677)
Date Thu, 04 Oct 2018 17:51:20 GMT
This is an automated email from the ASF dual-hosted git repository.

mmiller pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/master by this push:
     new c03b9c4  Set props path in ConfigOpts. Fixes #676 (#677)
c03b9c4 is described below

commit c03b9c4327c51103b4e166dca59079ff30b88868
Author: Mike Miller <mmiller@apache.org>
AuthorDate: Thu Oct 4 13:51:12 2018 -0400

    Set props path in ConfigOpts. Fixes #676 (#677)
---
 .../main/java/org/apache/accumulo/core/cli/ConfigOpts.java   | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/core/src/main/java/org/apache/accumulo/core/cli/ConfigOpts.java b/core/src/main/java/org/apache/accumulo/core/cli/ConfigOpts.java
index 07d7c3d..70797d7 100644
--- a/core/src/main/java/org/apache/accumulo/core/cli/ConfigOpts.java
+++ b/core/src/main/java/org/apache/accumulo/core/cli/ConfigOpts.java
@@ -39,7 +39,10 @@ public class ConfigOpts extends Help {
       + "The classpath will be searched if this property is not set")
   private String propsPath;
 
-  public String getPropertiesPath() {
+  public synchronized String getPropertiesPath() {
+    if (propsPath == null) {
+      propsPath = SiteConfiguration.getAccumuloPropsLocation().getFile();
+    }
     return propsPath;
   }
 
@@ -59,12 +62,7 @@ public class ConfigOpts extends Help {
 
   public synchronized SiteConfiguration getSiteConfiguration() {
     if (siteConfig == null) {
-      if (propsPath != null) {
-        siteConfig = new SiteConfiguration(new File(propsPath), getOverrides());
-      } else {
-        siteConfig = new SiteConfiguration(SiteConfiguration.getAccumuloPropsLocation(),
-            getOverrides());
-      }
+      siteConfig = new SiteConfiguration(new File(getPropertiesPath()), getOverrides());
     }
     return siteConfig;
   }


Mime
View raw message