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 AA71CD60B for ; Tue, 21 May 2013 16:59:22 +0000 (UTC) Received: (qmail 89384 invoked by uid 500); 21 May 2013 16:59:22 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 89313 invoked by uid 500); 21 May 2013 16:59:22 -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 89286 invoked by uid 99); 21 May 2013 16:59:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 May 2013 16:59:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 May 2013 16:59:19 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 60CEB23889E3; Tue, 21 May 2013 16:58:59 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1484874 - in /accumulo/trunk: ./ core/ core/src/main/java/org/apache/accumulo/core/conf/ core/src/test/java/org/apache/accumulo/core/conf/ examples/ examples/simple/ proxy/ server/ start/ test/ Date: Tue, 21 May 2013 16:58:58 -0000 To: commits@accumulo.apache.org From: cjnolet@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130521165859.60CEB23889E3@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: cjnolet Date: Tue May 21 16:58:58 2013 New Revision: 1484874 URL: http://svn.apache.org/r1484874 Log: Merging 1.5 with trunk. Modified: accumulo/trunk/ (props changed) accumulo/trunk/core/ (props changed) accumulo/trunk/core/pom.xml accumulo/trunk/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java accumulo/trunk/core/src/main/java/org/apache/accumulo/core/conf/Property.java accumulo/trunk/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java accumulo/trunk/examples/ (props changed) accumulo/trunk/examples/simple/pom.xml accumulo/trunk/proxy/pom.xml accumulo/trunk/server/ (props changed) accumulo/trunk/server/pom.xml accumulo/trunk/start/pom.xml accumulo/trunk/test/pom.xml Propchange: accumulo/trunk/ ------------------------------------------------------------------------------ Merged /accumulo/branches/1.5:r1484297-1484330,1484332-1484336,1484340-1484579,1484581-1484866 Propchange: accumulo/trunk/core/ ------------------------------------------------------------------------------ Merged /accumulo/branches/1.5/core:r1484297-1484330,1484332-1484336,1484340-1484579,1484581-1484866 Modified: accumulo/trunk/core/pom.xml URL: http://svn.apache.org/viewvc/accumulo/trunk/core/pom.xml?rev=1484874&r1=1484873&r2=1484874&view=diff ============================================================================== --- accumulo/trunk/core/pom.xml (original) +++ accumulo/trunk/core/pom.xml Tue May 21 16:58:58 2013 @@ -34,6 +34,22 @@ jline + org.apache.accumulo + accumulo-fate + + + org.apache.accumulo + accumulo-start + + + org.apache.accumulo + accumulo-trace + + + org.apache.commons + commons-vfs2 + + org.apache.thrift libthrift @@ -78,21 +94,6 @@ provided - org.apache.accumulo - accumulo-fate - provided - - - org.apache.accumulo - accumulo-start - provided - - - org.apache.accumulo - accumulo-trace - provided - - org.apache.hadoop hadoop-client provided Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java?rev=1484874&r1=1484873&r2=1484874&view=diff ============================================================================== --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java Tue May 21 16:58:58 2013 @@ -138,7 +138,7 @@ public class DefaultConfiguration extend } doc.println(indent(indentDepth) + "" + zoo + ""); doc.println(indent(indentDepth) + "
"
-              + (prop.getDefaultValue().isEmpty() ? " " : prop.getDefaultValue().replaceAll(" ", " ")) + "
"); + + (prop.getRawDefaultValue().isEmpty() ? " " : prop.getRawDefaultValue().replaceAll(" ", " ")) + ""); doc.println(indent(indentDepth) + "" + (isDeprecated ? "Deprecated. " : "") + prop.getDescription() + ""); doc.println(indent(--indentDepth) + ""); Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/conf/Property.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/conf/Property.java?rev=1484874&r1=1484873&r2=1484874&view=diff ============================================================================== --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/conf/Property.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/conf/Property.java Tue May 21 16:58:58 2013 @@ -28,31 +28,33 @@ import org.apache.accumulo.core.util.for 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.PropertiesConfiguration; +import org.apache.commons.configuration.SystemConfiguration; import org.apache.log4j.Logger; public enum Property { // Crypto-related properties CRYPTO_PREFIX("crypto.", null, PropertyType.PREFIX, "Properties in this category related to the configuration of both default and custom crypto modules.", - true), + true, false), CRYPTO_MODULE_CLASS("crypto.module.class", "NullCryptoModule", PropertyType.STRING, "Fully qualified class name of the class that implements the CryptoModule interface, to be used in setting up encryption at rest for the WAL and " - + "(future) other parts of the code.", true), - CRYPTO_CIPHER_SUITE("crypto.cipher.suite", "NullCipher", PropertyType.STRING, "Describes the cipher suite to use for the write-ahead log", true), + + "(future) other parts of the code.", true, false), + CRYPTO_CIPHER_SUITE("crypto.cipher.suite", "NullCipher", PropertyType.STRING, "Describes the cipher suite to use for the write-ahead log", true, false), CRYPTO_CIPHER_ALGORITHM_NAME("crypto.cipher.algorithm.name", "NullCipher", PropertyType.STRING, "States the name of the algorithm used in the corresponding cipher suite. Do not make these different, unless you enjoy mysterious exceptions and bugs.", - true), + true, false), CRYPTO_CIPHER_KEY_LENGTH("crypto.cipher.key.length", "128", PropertyType.STRING, - "Specifies the key length *in bits* to use for the symmetric key, should probably be 128 or 256 unless you really know what you're doing", true), + "Specifies the key length *in bits* to use for the symmetric key, should probably be 128 or 256 unless you really know what you're doing", true, false), CRYPTO_SECURE_RNG("crypto.secure.rng", "SHA1PRNG", PropertyType.STRING, - "States the secure random number generator to use, and defaults to the built-in Sun SHA1PRNG", true), + "States the secure random number generator to use, and defaults to the built-in Sun SHA1PRNG", true, false), CRYPTO_SECURE_RNG_PROVIDER("crypto.secure.rng.provider", "SUN", PropertyType.STRING, - "States the secure random number generator provider to use, and defaults to the built-in SUN provider", true), + "States the secure random number generator provider to use, and defaults to the built-in SUN provider", true, false), CRYPTO_SECRET_KEY_ENCRYPTION_STRATEGY_CLASS("crypto.secret.key.encryption.strategy.class", "NullSecretKeyEncryptionStrategy", PropertyType.STRING, - "The class Accumulo should use for its key encryption strategy.", true), + "The class Accumulo should use for its key encryption strategy.", true, false), CRYPTO_DEFAULT_KEY_STRATEGY_HDFS_URI("crypto.default.key.strategy.hdfs.uri", "", PropertyType.STRING, - "The URL Accumulo should use to connect to DFS. If this is blank, Accumulo will obtain this information from the Hadoop configuration", true), + "The URL Accumulo should use to connect to DFS. If this is blank, Accumulo will obtain this information from the Hadoop configuration", true, false), CRYPTO_DEFAULT_KEY_STRATEGY_KEY_LOCATION("crypto.default.key.strategy.key.location", "/accumulo/crypto/secret/keyEncryptionKey", PropertyType.ABSOLUTEPATH, - "The absolute path of where to store the key encryption key within HDFS.", true), + "The absolute path of where to store the key encryption key within HDFS.", true, false), // instance properties (must be the same for every node in an instance) INSTANCE_PREFIX("instance.", null, PropertyType.PREFIX, @@ -221,10 +223,10 @@ public enum Property { MONITOR_BANNER_COLOR("monitor.banner.color", "#c4c4c4", PropertyType.STRING, "The color of the banner text displayed on the monitor page."), MONITOR_BANNER_BACKGROUND("monitor.banner.background", "#304065", PropertyType.STRING, "The background color of the banner text displayed on the monitor page."), - MONITOR_SSL_KEYSTORE("monitor.ssl.keyStore", "", PropertyType.PATH, "The keystore for enabling monitor SSL.", true), - MONITOR_SSL_KEYSTOREPASS("monitor.ssl.keyStorePassword", "", PropertyType.STRING, "The keystore password for enabling monitor SSL.", true), - MONITOR_SSL_TRUSTSTORE("monitor.ssl.trustStore", "", PropertyType.PATH, "The truststore for enabling monitor SSL.", true), - MONITOR_SSL_TRUSTSTOREPASS("monitor.ssl.trustStorePassword", "", PropertyType.STRING, "The truststore password for enabling monitor SSL.", true), + MONITOR_SSL_KEYSTORE("monitor.ssl.keyStore", "", PropertyType.PATH, "The keystore for enabling monitor SSL.", true, false), + MONITOR_SSL_KEYSTOREPASS("monitor.ssl.keyStorePassword", "", PropertyType.STRING, "The keystore password for enabling monitor SSL.", true, false), + MONITOR_SSL_TRUSTSTORE("monitor.ssl.trustStore", "", PropertyType.PATH, "The truststore for enabling monitor SSL.", true, false), + MONITOR_SSL_TRUSTSTOREPASS("monitor.ssl.trustStorePassword", "", PropertyType.STRING, "The truststore password for enabling monitor SSL.", true, false), TRACE_PREFIX("trace.", null, PropertyType.PREFIX, "Properties in this category affect the behavior of distributed tracing."), TRACE_PORT("trace.port.client", "12234", PropertyType.PORT, "The listening port for the trace server"), @@ -340,26 +342,27 @@ public enum Property { + "You can enable post delegation for a context, which will load classes from the context first instead of the parent first. " + "Do this by setting general.vfs.context.classpath.<name>.delegation=post, where <name> is your context name. " + "If delegation is not specified, it defaults to loading from parent classloader first."), - VFS_CLASSLOADER_CACHE_DIR(AccumuloVFSClassLoader.VFS_CACHE_DIR, new File(System.getProperty("java.io.tmpdir"), "accumulo-vfs-cache-" - + System.getProperty("user.name", "nouser")).getAbsolutePath(), PropertyType.ABSOLUTEPATH, - "Directory to use for the vfs cache. The cache will keep a soft reference to all of the classes loaded in the VM." - + " This should be on local disk on each node with sufficient space. It defaults to /tmp", false); + VFS_CLASSLOADER_CACHE_DIR(AccumuloVFSClassLoader.VFS_CACHE_DIR, "${java.io.tmpdir}" + File.separator + "accumulo-vfs-cache-${user.name}", + PropertyType.ABSOLUTEPATH, "Directory to use for the vfs cache. The cache will keep a soft reference to all of the classes loaded in the VM." + + " This should be on local disk on each node with sufficient space. It defaults to ${java.io.tmpdir}/accumulo-vfs-cache-${user.name}", false, true); private String key, defaultValue, description; private PropertyType type; private boolean experimental; + private boolean interpolated; static Logger log = Logger.getLogger(Property.class); - private Property(String name, String defaultValue, PropertyType type, String description, boolean experimental) { + private Property(String name, String defaultValue, PropertyType type, String description, boolean experimental, boolean interpolated) { this.key = name; this.defaultValue = defaultValue; this.description = description; this.type = type; this.experimental = experimental; + this.interpolated = interpolated; } private Property(String name, String defaultValue, PropertyType type, String description) { - this(name, defaultValue, type, description, false); + this(name, defaultValue, type, description, false, false); } @Override @@ -371,10 +374,25 @@ public enum Property { return this.key; } - public String getDefaultValue() { + public String getRawDefaultValue() { return this.defaultValue; } + public String getDefaultValue() { + if (this.interpolated) { + PropertiesConfiguration pconf = new PropertiesConfiguration(); + pconf.append(new SystemConfiguration()); + pconf.addProperty("hack_default_value", this.defaultValue); + String v = pconf.getString("hack_default_value"); + if (this.type == PropertyType.ABSOLUTEPATH) + return new File(v).getAbsolutePath(); + else + return v; + } else { + return getRawDefaultValue(); + } + } + public PropertyType getType() { return this.type; } Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java?rev=1484874&r1=1484873&r2=1484874&view=diff ============================================================================== --- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java (original) +++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java Tue May 21 16:58:58 2013 @@ -16,9 +16,11 @@ */ package org.apache.accumulo.core.conf; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import java.io.File; import java.util.HashSet; import org.junit.Test; @@ -99,4 +101,12 @@ public class PropertyTest { // typeCheckValidFormat(PropertyType.ABSOLUTEPATH, "d:\\foo12", "c:\\foo\\g", "c:\\foo\\c", "c:\\"); typeCheckInvalidFormat(PropertyType.ABSOLUTEPATH, "foo12", "foo/g", "foo\\c"); } + + @Test + public void testRawDefaultValues() { + AccumuloConfiguration conf = AccumuloConfiguration.getDefaultConfiguration(); + assertEquals("${java.io.tmpdir}" + File.separator + "accumulo-vfs-cache-${user.name}", Property.VFS_CLASSLOADER_CACHE_DIR.getRawDefaultValue()); + assertEquals(new File(System.getProperty("java.io.tmpdir"), "accumulo-vfs-cache-" + System.getProperty("user.name")).getAbsolutePath(), + conf.get(Property.VFS_CLASSLOADER_CACHE_DIR)); + } } Propchange: accumulo/trunk/examples/ ------------------------------------------------------------------------------ Merged /accumulo/branches/1.5/examples:r1484297-1484330,1484332-1484336,1484340-1484579,1484581-1484866 Modified: accumulo/trunk/examples/simple/pom.xml URL: http://svn.apache.org/viewvc/accumulo/trunk/examples/simple/pom.xml?rev=1484874&r1=1484873&r2=1484874&view=diff ============================================================================== --- accumulo/trunk/examples/simple/pom.xml (original) +++ accumulo/trunk/examples/simple/pom.xml Tue May 21 16:58:58 2013 @@ -30,6 +30,10 @@ jcommander
+ org.apache.accumulo + accumulo-core + + commons-cli commons-cli provided @@ -40,11 +44,6 @@ provided - commons-collections - commons-collections - provided - - commons-httpclient commons-httpclient provided @@ -60,11 +59,6 @@ provided - org.apache.accumulo - accumulo-core - provided - - org.apache.hadoop hadoop-client provided Modified: accumulo/trunk/proxy/pom.xml URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/pom.xml?rev=1484874&r1=1484873&r2=1484874&view=diff ============================================================================== --- accumulo/trunk/proxy/pom.xml (original) +++ accumulo/trunk/proxy/pom.xml Tue May 21 16:58:58 2013 @@ -34,18 +34,16 @@ guava - org.apache.thrift - libthrift + org.apache.accumulo + accumulo-core - commons-collections - commons-collections - provided + org.apache.accumulo + accumulo-server - commons-configuration - commons-configuration - provided + org.apache.thrift + libthrift commons-io @@ -58,31 +56,6 @@ provided - org.apache.accumulo - accumulo-core - provided - - - org.apache.accumulo - accumulo-fate - provided - - - org.apache.accumulo - accumulo-server - provided - - - org.apache.accumulo - accumulo-start - provided - - - org.apache.accumulo - accumulo-trace - provided - - org.apache.hadoop hadoop-client provided Propchange: accumulo/trunk/server/ ------------------------------------------------------------------------------ Merged /accumulo/branches/1.5/server:r1484297-1484330,1484332-1484336,1484340-1484579,1484581-1484866 Modified: accumulo/trunk/server/pom.xml URL: http://svn.apache.org/viewvc/accumulo/trunk/server/pom.xml?rev=1484874&r1=1484873&r2=1484874&view=diff ============================================================================== --- accumulo/trunk/server/pom.xml (original) +++ accumulo/trunk/server/pom.xml Tue May 21 16:58:58 2013 @@ -42,6 +42,22 @@ jline + org.apache.accumulo + accumulo-core + + + org.apache.accumulo + accumulo-fate + + + org.apache.accumulo + accumulo-start + + + org.apache.accumulo + accumulo-trace + + org.apache.thrift libthrift @@ -81,26 +97,6 @@ provided - org.apache.accumulo - accumulo-core - provided - - - org.apache.accumulo - accumulo-fate - provided - - - org.apache.accumulo - accumulo-start - provided - - - org.apache.accumulo - accumulo-trace - provided - - org.apache.hadoop hadoop-client provided Modified: accumulo/trunk/start/pom.xml URL: http://svn.apache.org/viewvc/accumulo/trunk/start/pom.xml?rev=1484874&r1=1484873&r2=1484874&view=diff ============================================================================== --- accumulo/trunk/start/pom.xml (original) +++ accumulo/trunk/start/pom.xml Tue May 21 16:58:58 2013 @@ -30,11 +30,6 @@ commons-vfs2 - commons-configuration - commons-configuration - provided - - commons-io commons-io provided Modified: accumulo/trunk/test/pom.xml URL: http://svn.apache.org/viewvc/accumulo/trunk/test/pom.xml?rev=1484874&r1=1484873&r2=1484874&view=diff ============================================================================== --- accumulo/trunk/test/pom.xml (original) +++ accumulo/trunk/test/pom.xml Tue May 21 16:58:58 2013 @@ -34,62 +34,47 @@ jline - org.apache.thrift - libthrift - - - commons-cli - commons-cli - provided - - - commons-codec - commons-codec - provided + org.apache.accumulo + accumulo-core - commons-collections - commons-collections - provided + org.apache.accumulo + accumulo-fate - commons-configuration - commons-configuration - provided + org.apache.accumulo + accumulo-server - commons-io - commons-io - provided + org.apache.accumulo + accumulo-start - log4j - log4j - provided + org.apache.accumulo + accumulo-trace - org.apache.accumulo - accumulo-core - provided + org.apache.thrift + libthrift - org.apache.accumulo - accumulo-fate + commons-cli + commons-cli provided - org.apache.accumulo - accumulo-server + commons-codec + commons-codec provided - org.apache.accumulo - accumulo-start + commons-io + commons-io provided - org.apache.accumulo - accumulo-trace + log4j + log4j provided