Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-16356

Remove class-name dispatch in RemoteLogMetadataSerde

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 3.7.0
    • 3.8.0
    • Tiered-Storage

    Description

      The RemoteLogMetadataSerde#serialize receives a RemoteLogMetadata object, and has to dispatch to one of four serializers depending on it's type. This is done by taking the class name of the RemoteLogMetadata and looking it up in maps to find the corresponding serializer for that class.

      This later requires an unchecked cast, because the RemoteLogMetadataTransform is generic. This is all type-unsafe, and can be replaced with type-safe if-elseif-else statements that may also be faster than the double-indirect map lookups.

      Attachments

        Activity

          People

            linu Linu Shibu
            gharris1727 Greg Harris
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: