You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by vi...@apache.org on 2014/03/06 22:23:42 UTC
[1/2] git commit: ACCUMULO-2425 - making SystemConfigurations
synchronized until addressed in commons configuration
Repository: accumulo
Updated Branches:
refs/heads/1.6.0-SNAPSHOT 68afb1efb -> d2da4315c
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.6.0-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)
[2/2] git commit: Merge remote-tracking branch
'origin/1.5.2-SNAPSHOT' into 1.6.0-SNAPSHOT
Posted by vi...@apache.org.
Merge remote-tracking branch 'origin/1.5.2-SNAPSHOT' into 1.6.0-SNAPSHOT
Conflicts:
core/src/main/java/org/apache/accumulo/core/conf/Property.java
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/d2da4315
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/d2da4315
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/d2da4315
Branch: refs/heads/1.6.0-SNAPSHOT
Commit: d2da4315c6907ce9d1cf2f5128b5ebd00d14ee73
Parents: 68afb1e f76b8e0
Author: John Vines <vi...@apache.org>
Authored: Thu Mar 6 16:23:36 2014 -0500
Committer: John Vines <vi...@apache.org>
Committed: Thu Mar 6 16:23:36 2014 -0500
----------------------------------------------------------------------
.../java/org/apache/accumulo/core/conf/Interpolated.java | 5 ++++-
.../main/java/org/apache/accumulo/core/conf/Property.java | 8 ++++++--
2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/d2da4315/core/src/main/java/org/apache/accumulo/core/conf/Interpolated.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/conf/Interpolated.java
index d8d4499,0000000..1390db2
mode 100644,000000..100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/Interpolated.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/Interpolated.java
@@@ -1,30 -1,0 +1,33 @@@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.accumulo.core.conf;
+
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * An annotation to denote {@link AccumuloConfiguration} {@link Property} keys, whose values should be interpolated with system properties.
++ *
++ * 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.
+ */
+@Inherited
+@Retention(RetentionPolicy.RUNTIME)
+@interface Interpolated {
-
++
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/d2da4315/core/src/main/java/org/apache/accumulo/core/conf/Property.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/conf/Property.java
index abad4ad,557ca1f..fc4d012
--- a/core/src/main/java/org/apache/accumulo/core/conf/Property.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/Property.java
@@@ -18,12 -18,9 +18,13 @@@ package org.apache.accumulo.core.conf
import java.io.File;
import java.lang.annotation.Annotation;
+import java.util.Collections;
import java.util.EnumSet;
+import java.util.HashMap;
import java.util.HashSet;
+import java.util.Map;
+import java.util.Map.Entry;
+ import java.util.Properties;
import java.util.Set;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
@@@ -461,11 -387,14 +462,14 @@@ public enum Property
public String getRawDefaultValue() {
return this.defaultValue;
}
-
+
public String getDefaultValue() {
- if (this.interpolated) {
+ if (isInterpolated()) {
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)