GJL commented on a change in pull request #6288: [FLINK-9703] [flink-mesos]
Expose Prometheus port for TM through Mesos
URL: https://github.com/apache/flink/pull/6288#discussion_r226262274
##########
File path:
flink-mesos/src/main/java/org/apache/flink/mesos/runtime/clusterframework/LaunchableMesosWorker.java
##########
@@ -332,6 +334,27 @@ public String toString() {
return taskInfo.build();
}
+ /**
+ * Get the port keys representing the TM's configured endpoints. This
includes mandatory TM endpoints such as
+ * data and rpc as well as optionally configured endpoints for services
such as prometheus reporter
+ *
+ * @return A deterministicly ordered Set of port keys to expose from
the TM container
+ * @param config
+ */
+ static Set<String> extractPortKeys(Configuration config) {
+ LinkedHashSet<String> tmPortKeys = new
LinkedHashSet<>(Arrays.asList(TM_PORT_KEYS));
+
+ if (config.containsKey(PORT_ASSIGNMENT_KEY)) {
+ String portAssignments =
config.getString(PORT_ASSIGNMENT_KEY, "");
+ Arrays.stream(portAssignments.split(","))
+ .map(String::trim)
+ .peek(key -> LOG.debug("Adding port key " + key
+ " to mesos request"))
Review comment:
Slf4j place holder should be preferred to avoid String concatenation, i.e.,
`LOG.debug("Adding port key {} to mesos request", key)`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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