You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Chesnay Schepler (Jira)" <ji...@apache.org> on 2020/06/26 12:36:00 UTC

[jira] [Created] (FLINK-18435) Allow reporter factories to intercept reflection-based instantiation attempts

Chesnay Schepler created FLINK-18435:
----------------------------------------

             Summary: Allow reporter factories to intercept reflection-based instantiation attempts
                 Key: FLINK-18435
                 URL: https://issues.apache.org/jira/browse/FLINK-18435
             Project: Flink
          Issue Type: Improvement
          Components: Runtime / Metrics
            Reporter: Chesnay Schepler
            Assignee: Chesnay Schepler
             Fix For: 1.12.0


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



--
This message was sent by Atlassian Jira
(v8.3.4#803005)