[ 
https://issues.apache.org/jira/browse/PHOENIX-2902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15351232#comment-15351232
 ] 

James Taylor commented on PHOENIX-2902:
---------------------------------------

bq. Is setting properties in hbase-site.xml or passing during connection can be 
handled differently.
Yes, properties that come from hbase-site.xml are static - they're read once 
when the clients connects to the cluster (in ConnectionQueryService). We 
simulate this in the @BeforeClass method of our integration tests. For example, 
from StatsCollectorIT:
{code}
    @BeforeClass
    public static void doSetup() throws Exception {
        Map<String,String> props = Maps.newHashMapWithExpectedSize(10);
        // Must update config before starting server
        props.put(QueryServices.STATS_GUIDEPOST_WIDTH_BYTES_ATTRIB, 
Long.toString(20));
        props.put(QueryServices.EXPLAIN_CHUNK_COUNT_ATTRIB, 
Boolean.TRUE.toString());
        props.put(QueryServices.EXPLAIN_ROW_COUNT_ATTRIB, 
Boolean.TRUE.toString());
        props.put(QueryServices.QUEUE_SIZE_ATTRIB, Integer.toString(1024));
        props.put(QueryServices.TRANSACTIONS_ENABLED, Boolean.toString(true));
        setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
    }
{code}
Connection properties are properties that are passed through at connection 
time. Connections come and go as they are opened and closed. There properties 
override the ones from hbase-site.xml.

However, some properties, like the IS_NAMESPACE_MAPPING_ENABLED and 
IS_SYSTEM_TABLE_MAPPED_TO_NAMESPACE do not make sense to toggle back and forth 
as connections are opened and closed. Instead, they should be set once in 
hbase-site.xml and not really changed after that. For example, I don't think 
you can convert your tables to be namespace aware and then set these config 
properties back to saying that namespaces aren't enabled.

As far as hardcoding the call to set the namespaces as always being enabled 
when deletePriorTables is called, that doesn't make sense. Won't some tests 
expect namespaces to not be enabled too? For tests that are relying on them to 
be enabled, you'd want to set them in the @BeforeClass method as mentioned 
above - in that case this property would be set when deletePriorTables is 
called as well.

[~samarthjain] should be able to help you with this stuff as well.

> Adjust PhoenixDatabaseMetadata#getSchemas query if namespaces are enabled
> -------------------------------------------------------------------------
>
>                 Key: PHOENIX-2902
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2902
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.8.0
>            Reporter: James Taylor
>            Assignee: Ankit Singhal
>             Fix For: 4.8.0
>
>         Attachments: PHOENIX-2902.patch
>
>
> The call to PhoenixDatabaseMetaData.getSchemas() currently queries the 
> SYSTEM.CATALOG table to find distinct schema names. If namespaces are 
> enabled, we should likely adjust the query accordingly.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to