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 9A401200CF3 for ; Wed, 13 Sep 2017 20:01:24 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9908D1609CA; Wed, 13 Sep 2017 18:01:24 +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 DD8B11609C3 for ; Wed, 13 Sep 2017 20:01:23 +0200 (CEST) Received: (qmail 33781 invoked by uid 500); 13 Sep 2017 18:01:22 -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 33765 invoked by uid 99); 13 Sep 2017 18:01:22 -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; Wed, 13 Sep 2017 18:01:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3915CF56C6; Wed, 13 Sep 2017 18:01:22 +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: <20170913180122.3915CF56C6@git1-us-west.apache.org> Date: Wed, 13 Sep 2017 18:01:22 +0000 (UTC) archived-at: Wed, 13 Sep 2017 18:01:24 -0000 Github user paul-rogers commented on a diff in the pull request: https://github.com/apache/drill/pull/923#discussion_r138689935 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/server/options/OptionManager.java --- @@ -17,49 +17,97 @@ */ package org.apache.drill.exec.server.options; -import org.apache.drill.exec.server.options.OptionValue.OptionType; +import javax.validation.constraints.NotNull; /** * Manager for Drill {@link OptionValue options}. Implementations must be case-insensitive to the name of an option. */ public interface OptionManager extends OptionSet, Iterable { /** - * Sets an option value. - * - * @param value option value - * @throws org.apache.drill.common.exceptions.UserException message to describe error with value + * Sets a boolean option on the {@link OptionManager}. + * @param name The name of the option. + * @param value The value of the option. */ - void setOption(OptionValue value); + void setLocalOption(String name, boolean value); /** - * Deletes the option. Unfortunately, the type is required given the fallback structure of option managers. - * See {@link FallbackOptionManager}. + * Sets a long option on the {@link OptionManager}. + * @param name The name of the option. + * @param value The value of the option. + */ + void setLocalOption(String name, long value); + + /** + * Sets a double option on the {@link OptionManager}. + * @param name The name of the option. + * @param value The value of the option. + */ + void setLocalOption(String name, double value); + + /** + * Sets a String option on the {@link OptionManager}. + * @param name The name of the option. + * @param value The value of the option. + */ + void setLocalOption(String name, String value); + + /** + * Sets an option of the specified {@link OptionValue.Kind} on the {@link OptionManager}. + * @param kind The kind of the option. + * @param name The name of the option. + * @param value The value of the option. + */ + void setLocalOption(OptionValue.Kind kind, String name, String value); + + /** + * Deletes the option. * - * If the option name is valid (exists in {@link SystemOptionManager#VALIDATORS}), + * If the option name is valid (exists in the set of validators produced by {@link SystemOptionManager#createDefaultOptionDefinitions()}), * but the option was not set within this manager, calling this method should be a no-op. * * @param name option name - * @param type option type * @throws org.apache.drill.common.exceptions.UserException message to describe error with value */ - void deleteOption(String name, OptionType type); + void deleteLocalOption(String name); /** - * Deletes all options. Unfortunately, the type is required given the fallback structure of option managers. - * See {@link FallbackOptionManager}. + * Deletes all options. * * If no options are set, calling this method should be no-op. * - * @param type option type * @throws org.apache.drill.common.exceptions.UserException message to describe error with value */ - void deleteAllOptions(OptionType type); + void deleteAllLocalOptions(); + + /** + * Get the option definition corresponding to the given option name. + * @param name The name of the option to retrieve a validator for. + * @return The option validator corresponding to the given option name. + */ + @NotNull + OptionDefinition getOptionDefinition(String name); /** * Gets the list of options managed this manager. * * @return the list of options */ OptionList getOptionList(); + + /** + * Returns all the internal options contained in this option manager. + * + * @return All the internal options contained in this option manager. + */ + @NotNull + OptionList getInternalOptionList(); --- End diff -- Thanks for the explanation. ---