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

Allow reporter factories to intercept reflection-based instantiation attempts

    XMLWordPrintableJSON

Details

    Description

      Before 1.11 to use a reporter its class was configured, and the instance instantiated via reflection.
      We then introduced reporter factories, and added an annotation for redirection instantiation attempts from the reporter class to factories, by annotating the reporter class with InstantiateViaFactory.
      However, when we migrated reporters to plugins, this approach stopped working, the reason being that it required the reporter class to be accessible. The plugin system only exposes the factories however.

      To ensure that existing configurations continue to work, I propose to add a new InterceptInstantiationViaReflection annotation for factories, with which they can specify a class name to intercept reflection-based instantiation attempts.

      Basically, we just invert the InstantiateViaFactory logic.
      Instead of the reporter saying "This factory should be used to instantiate me.", the factory now say "I can instantiate that reporter."

      Attachments

        Issue Links

          Activity

            People

              chesnay Chesnay Schepler
              chesnay Chesnay Schepler
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: