Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-9803

Drop canEqual() from TypeSerializer

    XMLWordPrintableJSON

Details

    • Hide
      The {{canEqual}} method is removed from the {{TypeSerializer}} abstraction.
      The "canEqual()" methods are usually used to make proper equality checks across hierarchies of types. The {{TypeSerializer}} actually doesn't require this property, so the method is now removed.
      Show
      The {{canEqual}} method is removed from the {{TypeSerializer}} abstraction. The "canEqual()" methods are usually used to make proper equality checks across hierarchies of types. The {{TypeSerializer}} actually doesn't require this property, so the method is now removed.

    Description

      See discussion from https://lists.apache.org/thread.html/7cc6cfd66e96e8d33c768629b55481b6c951c68128f10256abb328fe@%3Cdev.flink.apache.org%3E

      Hi all!

      As part of an attempt to simplify some code in the TypeInfo and
      TypeSerializer area, I would like to drop the "canEqual" methods for the
      following reason:

      "canEqual()" is necessary to make proper equality checks across hierarchies
      of types. This is for example useful in a collection API, stating for
      example whether a List can be equal to a Collection if they have the same
      contents. We don't have that here.

      A certain type information (and serializer) is equal to another one if they
      describe the same type, strictly. There is no necessity for cross hierarchy
      checks.

      This has also let to the situation that most type infos and serializers
      implement just a dummy/default version of "canEqual". Many "equals()"
      methods do not even call the other object's "canEqual", etc.

      As a first step, we could simply deprecate the method and implement an
      empty default, and remove all calls to that method.
      Best,
      Stephan

      This is a reduced version of FLINK-9798, we can't modify TypeInformation because it is @Public. We should change TypeSerializer now because we're already breaking it as part of FLINK-9376.

      Attachments

        Issue Links

          Activity

            People

              aljoscha Aljoscha Krettek
              aljoscha Aljoscha Krettek
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m