You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Loknath Priyatham Teja Singamsetty (JIRA)" <ji...@apache.org> on 2016/07/26 12:04:20 UTC
[jira] [Commented] (PHOENIX-3119) Setup of mini cluster after tear
down still applies older cluster configs in BaseTest.java
[ https://issues.apache.org/jira/browse/PHOENIX-3119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15393691#comment-15393691 ]
Loknath Priyatham Teja Singamsetty commented on PHOENIX-3119:
--------------------------------------------------------------
[~jamestaylor] Would like to understand the need for declaring config variable as static final in BaseTest.java
{code}
protected static final Configuration config = HBaseConfiguration.create(); {code}
> Setup of mini cluster after tear down still applies older cluster configs in BaseTest.java
> ------------------------------------------------------------------------------------------
>
> Key: PHOENIX-3119
> URL: https://issues.apache.org/jira/browse/PHOENIX-3119
> Project: Phoenix
> Issue Type: Bug
> Reporter: Loknath Priyatham Teja Singamsetty
> Assignee: Loknath Priyatham Teja Singamsetty
>
> Problem:
> ------------
> Setup of mini cluster after tear down still applies older cluster configs in BaseTest.java
> Root Cause:
> ---------------
> In BaseTest.java, we have static final instance of Configuration object initialised:
> protected static final Configuration config = HBaseConfiguration.create();
> The contents of this final instance of Configuration object is being modified dynamically inside setUpConfigForMiniCluster() -> setDefaultTestConfig(conf, overrideProps),
> private static void setDefaultTestConfig(Configuration conf, ReadOnlyProps overrideProps) {
> ConfigUtil.setReplicationConfigIfAbsent(conf);
> QueryServices services = new PhoenixTestDriver().getQueryServices();
> for (Entry<String,String> entry : services.getProps()) {
> conf.set(entry.getKey(), entry.getValue());
> }
> //no point doing sanity checks when running tests.
> conf.setBoolean("hbase.table.sanity.checks", false);
> // set the server rpc controller and rpc scheduler factory, used to configure the cluster
> conf.set(RpcControllerFactory.CUSTOM_CONTROLLER_CONF_KEY, DEFAULT_SERVER_RPC_CONTROLLER_FACTORY);
> conf.set(RSRpcServices.REGION_SERVER_RPC_SCHEDULER_FACTORY_CLASS, DEFAULT_RPC_SCHEDULER_FACTORY);
>
> // override any defaults based on overrideProps
> for (Entry<String,String> entry : overrideProps) {
> conf.set(entry.getKey(), entry.getValue());
> }
> }
> Solution:
> ------------
> When the static final instance needs to be modified, its better to work on clone instance of Configuration object.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)