Uploaded image for project: 'Samza'
  1. Samza
  2. SAMZA-554

Simplify serde configuration by providing default serde names

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.8.0
    • Fix Version/s: 0.9.0
    • Component/s: container
    • Labels:
      None

      Description

      Currently we provide StringSerde, JsonSerde, IntegerSerde, etc out of box. In order to use them, we always need to set,

       serializers.registry.json.class=org.apache.samza.serializers.JsonSerdeFactory
       serializers.registry.string.class=org.apache.samza.serializers.StringSerdeFactory
       serializers.registry.integer.class=org.apache.samza.serializers.IntegerSerdeFactory
      

      then we can use the serde name "json"

      systems.kafka.samza.msg.serde=json
      

      I think it will be more convenient if the system looks for these default serde names (such as "string", "json", "integer", etc). Then users do not need to worry about putting these out-of-box serde factories in the "registry" part which is kinda error-prone.

      Of course, it still allows users to override the serde name if they want and throws exceptions when it can not find the serde factory.

      1. SAMZA-554.3.patch
        5 kB
        Yan Fang
      2. SAMZA-554.2.patch
        5 kB
        Yan Fang
      3. SAMZA-554.patch
        3 kB
        Yan Fang

        Activity

        Hide
        closeuris Yan Fang added a comment -

        Committed to master. Thank you.

        Show
        closeuris Yan Fang added a comment - Committed to master. Thank you.
        Hide
        criccomini Chris Riccomini added a comment -

        +1

        Show
        criccomini Chris Riccomini added a comment - +1
        Hide
        closeuris Yan Fang added a comment -

        Thanks, Chris Riccomini. Since the Java Serde accepts type parameter, not sure if I did it correctly. Could you just have a look at it? https://reviews.apache.org/r/30920/diff/2-3/

        Show
        closeuris Yan Fang added a comment - Thanks, Chris Riccomini . Since the Java Serde accepts type parameter, not sure if I did it correctly. Could you just have a look at it? https://reviews.apache.org/r/30920/diff/2-3/
        Hide
        criccomini Chris Riccomini added a comment -

        +1

        Could you add the Java serde as well (SAMZA-547)? Don't block on a second +1, just update and commit.

        Show
        criccomini Chris Riccomini added a comment - +1 Could you add the Java serde as well ( SAMZA-547 )? Don't block on a second +1, just update and commit.
        Hide
        closeuris Yan Fang added a comment -

        Thanks for reviewing. Updated the patch based on Chris Riccomini's comment in RB.

        https://reviews.apache.org/r/30920/

        Thank you.

        Show
        closeuris Yan Fang added a comment - Thanks for reviewing. Updated the patch based on Chris Riccomini 's comment in RB. https://reviews.apache.org/r/30920/ Thank you.
        Hide
        criccomini Chris Riccomini added a comment -

        Comments on RB. Looks good, overall. Minor nit, and also unit tests would be good.

        Show
        criccomini Chris Riccomini added a comment - Comments on RB. Looks good, overall. Minor nit, and also unit tests would be good.
        Hide
        closeuris Yan Fang added a comment -

        RB: https://reviews.apache.org/r/30920/

        Attached the patch.

        Thank you.

        Show
        closeuris Yan Fang added a comment - RB: https://reviews.apache.org/r/30920/ Attached the patch. Thank you.
        Hide
        criccomini Chris Riccomini added a comment -

        +1 I agree. This was raised several times to me in person. We should have default serde names if the aren't over-ridden.

        Show
        criccomini Chris Riccomini added a comment - +1 I agree. This was raised several times to me in person. We should have default serde names if the aren't over-ridden.
        Hide
        closeuris Yan Fang added a comment -

        I mean, when the system sees serde names, such as "string”,"json", and does not find the "registery" properties, it will look for the serde factories inside the system. If still can not find, it throws exceptions.

        Show
        closeuris Yan Fang added a comment - I mean, when the system sees serde names, such as "string”,"json", and does not find the "registery" properties, it will look for the serde factories inside the system. If still can not find, it throws exceptions.

          People

          • Assignee:
            closeuris Yan Fang
            Reporter:
            closeuris Yan Fang
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development