Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D1A7C1096A for ; Fri, 7 Mar 2014 20:54:17 +0000 (UTC) Received: (qmail 22676 invoked by uid 500); 7 Mar 2014 20:53:56 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 21598 invoked by uid 500); 7 Mar 2014 20:53:23 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 21226 invoked by uid 99); 7 Mar 2014 20:53:18 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Mar 2014 20:53:18 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 652E593A88D; Fri, 7 Mar 2014 20:53:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: elserj@apache.org To: commits@accumulo.apache.org Date: Fri, 07 Mar 2014 20:53:54 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [40/50] [abbrv] git commit: Merge remote-tracking branch 'origin/1.5.2-SNAPSHOT' into 1.6.0-SNAPSHOT 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/ACCUMULO-2061 Commit: d2da4315c6907ce9d1cf2f5128b5ebd00d14ee73 Parents: 68afb1e f76b8e0 Author: John Vines Authored: Thu Mar 6 16:23:36 2014 -0500 Committer: John Vines 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)