You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/02/02 14:23:51 UTC

[jira] [Commented] (FLINK-5509) Replace QueryableStateClient keyHashCode argument

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

ASF GitHub Bot commented on FLINK-5509:
---------------------------------------

GitHub user dawidwys opened a pull request:

    https://github.com/apache/flink/pull/3255

    [FLINK-5509] Replace QueryableStateClient keyHashCode argument

    Thanks for contributing to Apache Flink. Before you open your pull request, please take the following check list into consideration.
    If your changes take all of the items into account, feel free to open your pull request. For more information and/or questions please refer to the [How To Contribute guide](http://flink.apache.org/how-to-contribute.html).
    In addition to going through the list, please provide a meaningful description of your changes.
    
    - [x] General
      - The pull request references the related JIRA issue ("[FLINK-XXX] Jira title text")
      - The pull request addresses only one issue
      - Each commit in the PR has a meaningful commit message (including the JIRA id)
    
    - [x] Documentation
      - Documentation has been added for new functionality
      - Old documentation affected by the pull request has been updated
      - JavaDoc for public methods has been added
    
    - [x] Tests & Build
      - Functionality added by the pull request is covered by tests
      - `mvn clean verify` has been executed successfully locally or a Travis build has passed


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dawidwys/flink keyHashCode

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/3255.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3255
    
----
commit e143e7d01af83c19169becfba6b7a25958f0f8b8
Author: Dawid Wysakowicz <da...@getindata.com>
Date:   2017-02-02T14:21:47Z

    [FLINK-5509] Replace QueryableStateClient keyHashCode argument

----


> Replace QueryableStateClient keyHashCode argument
> -------------------------------------------------
>
>                 Key: FLINK-5509
>                 URL: https://issues.apache.org/jira/browse/FLINK-5509
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Queryable State
>            Reporter: Ufuk Celebi
>            Assignee: Dawid Wysakowicz
>            Priority: Minor
>
> When going over the low level QueryableStateClient with [~NicoK] we noticed that the key hashCode argument can be confusing to users:
> {code}
> Future<byte[]> getKvState(
>   JobID jobId,
>   String name,
>   int keyHashCode,
>   byte[] serializedKeyAndNamespace)
> {code}
> The {{keyHashCode}} argument is the result of calling {{hashCode()}} on the key to look up. This is what is send to the JobManager in order to look up the location of the key. While pretty straight forward, it is repetitive and possibly confusing.
> As an alternative we suggest to make the method generic and simply call hashCode on the object ourselves. This way the user just provides the key object.
> Since there are some early users of the queryable state API already, we would suggest to rename the method in order to provoke a compilation error after upgrading to the actually released 1.2 version.
> (This would also work without renaming since the hashCode of Integer (what users currently provide) is the same number, but it would be confusing why it acutally works.)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)