From commits-return-21429-archive-asf-public=cust-asf.ponee.io@accumulo.apache.org Thu Feb 1 18:41:20 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 6EB6B180652 for ; Thu, 1 Feb 2018 18:41:20 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 5E2F5160C35; Thu, 1 Feb 2018 17:41:20 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7DA3D160C44 for ; Thu, 1 Feb 2018 18:41:19 +0100 (CET) Received: (qmail 61334 invoked by uid 500); 1 Feb 2018 17:41:18 -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 61325 invoked by uid 99); 1 Feb 2018 17:41:18 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Feb 2018 17:41:18 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 12FB485898; Thu, 1 Feb 2018 17:41:18 +0000 (UTC) Date: Thu, 01 Feb 2018 17:41:18 +0000 To: "commits@accumulo.apache.org" Subject: [accumulo] 01/01: Merge branch '1.7' into 1.8 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: kturner@apache.org In-Reply-To: <151750687793.8640.9572724516441029816@gitbox.apache.org> References: <151750687793.8640.9572724516441029816@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: accumulo X-Git-Refname: refs/heads/1.8 X-Git-Reftype: branch X-Git-Rev: 53c0e4ffd9083a7dc13c0d93c65b6a081da0cf56 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20180201174118.12FB485898@gitbox.apache.org> This is an automated email from the ASF dual-hosted git repository. kturner pushed a commit to branch 1.8 in repository https://gitbox.apache.org/repos/asf/accumulo.git commit 53c0e4ffd9083a7dc13c0d93c65b6a081da0cf56 Merge: d6d8a7d 1fe3ba1 Author: Keith Turner AuthorDate: Thu Feb 1 12:37:53 2018 -0500 Merge branch '1.7' into 1.8 .../org/apache/accumulo/core/conf/Property.java | 155 +++++++++++++-------- .../apache/accumulo/core/conf/PropertyTest.java | 58 ++++++++ 2 files changed, 156 insertions(+), 57 deletions(-) diff --cc core/src/main/java/org/apache/accumulo/core/conf/Property.java index 26762fb,1733124..f64b9e2 --- a/core/src/main/java/org/apache/accumulo/core/conf/Property.java +++ b/core/src/main/java/org/apache/accumulo/core/conf/Property.java @@@ -804,20 -811,12 +826,12 @@@ public enum Property * property key * @return true if key is valid for a table property (recognized, or has a recognized prefix) */ - public synchronized static boolean isValidTablePropertyKey(String key) { - if (validTableProperties == null) { - validTableProperties = new HashSet<>(); - for (Property p : Property.values()) { - if (!p.getType().equals(PropertyType.PREFIX) && p.getKey().startsWith(Property.TABLE_PREFIX.getKey())) { - validTableProperties.add(p.getKey()); - } - } - } - - return validTableProperties.contains(key) || key.startsWith(Property.TABLE_CONSTRAINT_PREFIX.getKey()) - || key.startsWith(Property.TABLE_ITERATOR_PREFIX.getKey()) || key.startsWith(Property.TABLE_LOCALITY_GROUP_PREFIX.getKey()) - || key.startsWith(Property.TABLE_COMPACTION_STRATEGY_PREFIX.getKey()) || key.startsWith(Property.TABLE_REPLICATION_TARGET.getKey()) - || key.startsWith(Property.TABLE_ARBITRARY_PROP_PREFIX.getKey()) || key.startsWith(TABLE_SAMPLER_OPTS.getKey()); + public static boolean isValidTablePropertyKey(String key) { + return validTableProperties.contains(key) + || (key.startsWith(Property.TABLE_PREFIX.getKey()) && (key.startsWith(Property.TABLE_CONSTRAINT_PREFIX.getKey()) + || key.startsWith(Property.TABLE_ITERATOR_PREFIX.getKey()) || key.startsWith(Property.TABLE_LOCALITY_GROUP_PREFIX.getKey()) - || key.startsWith(Property.TABLE_COMPACTION_STRATEGY_PREFIX.getKey()) || key.startsWith(Property.TABLE_REPLICATION_TARGET.getKey()) || key - .startsWith(Property.TABLE_ARBITRARY_PROP_PREFIX.getKey()))); ++ || key.startsWith(Property.TABLE_COMPACTION_STRATEGY_PREFIX.getKey()) || key.startsWith(Property.TABLE_REPLICATION_TARGET.getKey()) ++ || key.startsWith(Property.TABLE_ARBITRARY_PROP_PREFIX.getKey()) || key.startsWith(TABLE_SAMPLER_OPTS.getKey()))); } /** @@@ -851,10 -849,10 +865,9 @@@ */ public static boolean isValidZooPropertyKey(String key) { // white list prefixes - return key.startsWith(Property.TABLE_PREFIX.getKey()) || key.startsWith(Property.TSERV_PREFIX.getKey()) || key.startsWith(Property.LOGGER_PREFIX.getKey()) - || key.startsWith(Property.MASTER_PREFIX.getKey()) || key.startsWith(Property.GC_PREFIX.getKey()) - || key.startsWith(Property.MONITOR_PREFIX.getKey() + "banner.") || key.startsWith(VFS_CONTEXT_CLASSPATH_PROPERTY.getKey()) - || key.startsWith(REPLICATION_PREFIX.getKey()); + return key.startsWith(Property.TABLE_PREFIX.getKey()) || key.startsWith(Property.TSERV_PREFIX.getKey()) || key.startsWith(Property.MASTER_PREFIX.getKey()) + || key.startsWith(Property.GC_PREFIX.getKey()) || key.startsWith(Property.MONITOR_PREFIX.getKey() + "banner.") - || key.startsWith(VFS_CONTEXT_CLASSPATH_PROPERTY.getKey()) || key.startsWith(Property.TABLE_COMPACTION_STRATEGY_PREFIX.getKey()) - || key.startsWith(REPLICATION_PREFIX.getKey()); ++ || key.startsWith(VFS_CONTEXT_CLASSPATH_PROPERTY.getKey()) || key.startsWith(REPLICATION_PREFIX.getKey()); } /** diff --cc core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java index 79f2f21,d25c8c2..7d1c8dc --- a/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java +++ b/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java @@@ -151,4 -148,66 +152,61 @@@ public class PropertyTest } } } + - @Test - public void testGCDeadServerWaitSecond() { - assertEquals("1h", Property.GC_WAL_DEAD_SERVER_WAIT.getDefaultValue()); - } - + @SuppressWarnings("deprecation") + private Property getDeprecatedProperty() { + return Property.INSTANCE_DFS_DIR; + } + + @Test + public void testAnnotations() { + assertTrue(Property.TABLE_VOLUME_CHOOSER.isExperimental()); - assertFalse(Property.LOGGER_DIR.isExperimental()); ++ assertFalse(Property.TABLE_SAMPLER.isExperimental()); + + assertTrue(Property.INSTANCE_SECRET.isSensitive()); + assertFalse(Property.INSTANCE_VOLUMES.isSensitive()); + + assertTrue(getDeprecatedProperty().isDeprecated()); + assertFalse(Property.INSTANCE_VOLUMES_REPLACEMENTS.isDeprecated()); + + } + + @Test + public void testGetPropertyByKey() { + for (Property prop : Property.values()) { + assertSame(prop, Property.getPropertyByKey(prop.getKey())); + } + } + + @Test + public void testIsValidPropertyKey() { + for (Property prop : Property.values()) { + assertTrue(Property.isValidPropertyKey(prop.getKey())); + if (prop.getType().equals(PropertyType.PREFIX)) { + assertTrue(Property.isValidPropertyKey(prop.getKey() + "foo9")); + } + } + + assertFalse(Property.isValidPropertyKey("abc.def")); + } + + @Test + public void testIsValidTablePropertyKey() { + for (Property prop : Property.values()) { + if (prop.getKey().startsWith("table.") && !prop.getKey().equals("table.")) { + assertTrue(Property.isValidTablePropertyKey(prop.getKey())); + + if (prop.getType().equals(PropertyType.PREFIX)) { + assertTrue(Property.isValidTablePropertyKey(prop.getKey() + "foo9")); + } else { + assertFalse(Property.isValidTablePropertyKey(prop.getKey() + "foo9")); + } + } else { + assertFalse(Property.isValidTablePropertyKey(prop.getKey())); + } + + } + + assertFalse(Property.isValidTablePropertyKey("abc.def")); + } } -- To stop receiving notification emails like this one, please contact kturner@apache.org.