tillrohrmann commented on a change in pull request #8373:
[FLINK-11922][metrics] Support MetricReporter factories
URL: https://github.com/apache/flink/pull/8373#discussion_r282391295
##########
File path:
flink-metrics/flink-metrics-jmx/src/main/java/org/apache/flink/metrics/jmx/JMXReporter.java
##########
@@ -86,33 +88,24 @@ public String filterCharacters(String input) {
private final Map<Metric, ObjectName> registeredMetrics;
/** The server to which JMX clients connect to. Allows for better
control over port usage. */
- private JMXServer jmxServer;
+ @Nullable
+ private final JMXServer jmxServer;
- public JMXReporter() {
+ JMXReporter(final Optional<String> portsConfig) {
Review comment:
I think `Optional` parameters are considered a code smell:
https://rules.sonarsource.com/java/RSPEC-3553. If I remember correctly, then
they were intended as method return types but not input types. I would prefer
to simply pass in a `@Nullable` parameter.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services