You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Jan Fernando (JIRA)" <ji...@apache.org> on 2015/09/24 23:32:04 UTC

[jira] [Commented] (PHOENIX-2285) phoenix.query.timeoutMs doesn't allow callers to set the timeout to less than 1 second

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

Jan Fernando commented on PHOENIX-2285:
---------------------------------------

[~jamestaylor] I've attached a potential patch that will honor the phoenix.query.timeMs value to millisecond level granularity. The main changes are in PhoenixStatement, where I made changes to store the timeout value in milliseconds and not seconds. To honor the JDBC contract for setting query timeouts I now do the conversion on the set and get methods instead of at initialization time. BaseResultIterators no longer needs to convert the query time out to millis and just uses the millisecond value stored on the statement.

In terms of testing, I couldn't find any tests specific to the behavior of phoenix.query.timeMs and so went ahead added both unit and IT tests that are in the proposed patch. 

Let me know what you think.

cc [~samarthjain]

> phoenix.query.timeoutMs doesn't allow callers to set the timeout to less than 1 second
> --------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-2285
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2285
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.5.2
>            Reporter: Jan Fernando
>            Assignee: Jan Fernando
>         Attachments: PHOENIX-2285-v1.txt
>
>
> When creating a Phoenix JDBC connection I have a use case where I want to override the default value of phoenix.query.timeoutMs to a value of 200 ms. 
> Currently if you set phoenix.query.timeoutMs to less than 1000 ms, the timeout gets rounded up to 1000ms. This is because in PhoenixStatement.getDefaultQueryTimeout() we convert the value of phoenix.query.timeoutMs to seconds in order to be compliant with JDBC. In BaseResultIterators we then convert it back to millis. As a result of the conversion we loose the millisecond fidelity.
> A possible solution is to store the timeout value stored on the PhoenixStatement in both seconds and milliseconds. Then, in BaseResultIterators when we read the value from the statement we can check if the value exists in millisecond fidelity and if so use that value. Otherwise we would use the value in second granularity and convert. 
> This would allow Phoenix to remain JDBC compatible with second level granularity for setting query timeouts on statements, but allow millisecond granularity of timeouts by explicitly setting phoenix.query.timeoutMs on connection properties.



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