Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-5675 Improve Queryable State
  3. FLINK-5509

Replace QueryableStateClient keyHashCode argument

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.0
    • Labels:
      None

      Description

      When going over the low level QueryableStateClient with Nico Kruber we noticed that the key hashCode argument can be confusing to users:

      Future<byte[]> getKvState(
        JobID jobId,
        String name,
        int keyHashCode,
        byte[] serializedKeyAndNamespace)
      

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kkl0u Kostas Kloudas
                Reporter:
                uce Ufuk Celebi
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: