Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2FDE52004F5 for ; Fri, 1 Sep 2017 22:54:35 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2E80216DBC7; Fri, 1 Sep 2017 20:54:35 +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 7622516DBC5 for ; Fri, 1 Sep 2017 22:54:34 +0200 (CEST) Received: (qmail 85433 invoked by uid 500); 1 Sep 2017 20:54:33 -0000 Mailing-List: contact dev-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list dev@drill.apache.org Received: (qmail 84881 invoked by uid 99); 1 Sep 2017 20:54:33 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Sep 2017 20:54:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2062BF561A; Fri, 1 Sep 2017 20:54:33 +0000 (UTC) From: paul-rogers To: dev@drill.apache.org Reply-To: dev@drill.apache.org References: In-Reply-To: Subject: [GitHub] drill pull request #923: DRILL-5723: Added System Internal Options That can ... Content-Type: text/plain Message-Id: <20170901205433.2062BF561A@git1-us-west.apache.org> Date: Fri, 1 Sep 2017 20:54:33 +0000 (UTC) archived-at: Fri, 01 Sep 2017 20:54:35 -0000 Github user paul-rogers commented on a diff in the pull request: https://github.com/apache/drill/pull/923#discussion_r136656530 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/server/options/SystemOptionManager.java --- @@ -70,11 +69,13 @@ *

*/ -public class SystemOptionManager extends BaseOptionManager implements OptionManager, AutoCloseable { +public class SystemOptionManager extends BaseOptionManager implements AutoCloseable { private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(SystemOptionManager.class); - private CaseInsensitiveMap VALIDATORS; - public void populateValidators() { + public static final CaseInsensitiveMap DEFAULT_VALIDATORS = --- End diff -- This change reverses a change made by Jyothsna. While it seems reasonable to create a static table of validators, there is a subtle problem which Jyothsna's fix addressed. Under normal operation, we have exactly one Drillbit per process and thus exactly one system option manager. But, we have unit tests that create multiple Drillbits per process. This is the most convenient way to test concurrency issues in unit tests. In general, each Drillbit could define a different default value for the system/session option; perhaps to check forward/backward compatibility when the time comes to support rolling upgrades. In this model, each Drillbit will have a slightly different set of defaults. Thus, the option validator table must be a member variable of the system option manager; it cannot be global. Note also, in the existing tests with multiple Drillbits, a global table runs into a race condition during reading defaults from the config file if we use a single table. But, if we have a separate table per Drillbit, the race condition disappears. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---