You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2015/08/22 08:42:45 UTC

[jira] [Commented] (PHOENIX-2188) Overriding hbase.client.scanner.caching doesn't work

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

James Taylor commented on PHOENIX-2188:
---------------------------------------

This is likely more of a doc issue than a code issue. The only intent of the code in Phoenix was to prevent a scanner caching value of 1 (which used to be the default). If HBase has changed the default to something more sensible, then we wouldn't want to override it. As long as if it has been overridden in the hbase-sites.xml, Phoenix honors that value, we're ok.

> 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)