Repository: accumulo Updated Branches: refs/heads/1.5.2-SNAPSHOT 778fc985f -> f76b8e07a
ACCUMULO-2425 - making SystemConfigurations synchronized until addressed in commons configuration Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/f76b8e07 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/f76b8e07 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/f76b8e07 Branch: refs/heads/1.5.2-SNAPSHOT Commit: f76b8e07ac1f7247eb7a65ad887dce54b9b6aafd Parents: 778fc98 Author: John Vines <vi...@apache.org> Authored: Thu Mar 6 16:20:34 2014 -0500 Committer: John Vines <vi...@apache.org> Committed: Thu Mar 6 16:20:34 2014 -0500 ---------------------------------------------------------------------- .../java/org/apache/accumulo/core/conf/Property.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/f76b8e07/core/src/main/java/org/apache/accumulo/core/conf/Property.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/conf/Property.java b/core/src/main/java/org/apache/accumulo/core/conf/Property.java index 1c2dfdb..557ca1f 100644 --- a/core/src/main/java/org/apache/accumulo/core/conf/Property.java +++ b/core/src/main/java/org/apache/accumulo/core/conf/Property.java @@ -20,6 +20,7 @@ import java.io.File; import java.lang.annotation.Annotation; import java.util.EnumSet; import java.util.HashSet; +import java.util.Properties; import java.util.Set; import org.apache.accumulo.core.client.security.tokens.PasswordToken; @@ -28,8 +29,8 @@ import org.apache.accumulo.core.util.format.DefaultFormatter; import org.apache.accumulo.core.util.interpret.DefaultScanInterpreter; import org.apache.accumulo.start.classloader.AccumuloClassLoader; import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader; +import org.apache.commons.configuration.MapConfiguration; import org.apache.commons.configuration.PropertiesConfiguration; -import org.apache.commons.configuration.SystemConfiguration; import org.apache.log4j.Logger; public enum Property { @@ -364,6 +365,9 @@ public enum Property { this.description = description; this.type = type; this.experimental = experimental; + // Interpolated items need to be careful, as JVM properties could be updates and we may want that propogated when those changes occur. + // Currently only VFS_CLASSLOADER_CACHE_DIR, which isn't ZK mutable, is interpolated, so this shouldn't be an issue as java.io.tmpdir + // also shouldn't be changing. this.interpolated = interpolated; } @@ -387,7 +391,10 @@ public enum Property { public String getDefaultValue() { if (this.interpolated) { PropertiesConfiguration pconf = new PropertiesConfiguration(); - pconf.append(new SystemConfiguration()); + Properties systemProperties = System.getProperties(); + synchronized (systemProperties) { + pconf.append(new MapConfiguration(systemProperties)); + } pconf.addProperty("hack_default_value", this.defaultValue); String v = pconf.getString("hack_default_value"); if (this.type == PropertyType.ABSOLUTEPATH)