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)