Samarth Jain created PHOENIX-2188:
-------------------------------------

             Summary: Overriding hbase.client.scanner.caching doesn't work
                 Key: PHOENIX-2188
                 URL: https://issues.apache.org/jira/browse/PHOENIX-2188
             Project: Phoenix
          Issue Type: Bug
            Reporter: Samarth Jain


Below is the test I wrote which demonstrates that the phoenix's override of 
1000 for the scanner cache size is not being used:

{code} 
@Test
    public void testScannerCacheSize() throws Exception {
        Connection connection = 
DriverManager.getConnection("jdbc:phoenix:localhost:2181");
        PhoenixConnection phxConn = connection.unwrap(PhoenixConnection.class);
        // check config value in query services
        
System.out.println(PhoenixDriver.INSTANCE.getQueryServices().getProps().get(QueryServices.SCAN_CACHE_SIZE_ATTRIB));
       
        Statement stmt = phxConn.createStatement();
        PhoenixStatement phxStmt = stmt.unwrap(PhoenixStatement.class);
        // double check the config size by looking at statement fetch size
        System.out.println(phxStmt.getFetchSize());
        
    }
{code} 

The offending code snippet is:
{code}
 QueryServices.withDefaults() {
Configuration config = 
HBaseFactoryProvider.getConfigurationFactory().getConfiguration();
        QueryServicesOptions options = new QueryServicesOptions(config)
            .setIfUnset(STATS_USE_CURRENT_TIME_ATTRIB, 
DEFAULT_STATS_USE_CURRENT_TIME)
            ..........................
            .setIfUnset(SCAN_CACHE_SIZE_ATTRIB, DEFAULT_SCAN_CACHE_SIZE)
{code} 
The configuration returned by 
HBaseFactoryProvider.getConfigurationFactory().getConfiguration() has the 
hbase.client.scanner.caching set to 100. So the override doesn't take place 
because we are using setIfUnset.
 
Another override that I see that potentially won't work in future if HBase 
provides its own default is the RpcControllerFactory - 
hbase.rpc.controllerfactory.class because of
{code}
setIfUnset(RpcControllerFactory.CUSTOM_CONTROLLER_CONF_KEY, 
DEFAULT_CLIENT_RPC_CONTROLLER_FACTORY)
{code}



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

Reply via email to