[
https://issues.apache.org/jira/browse/FLINK-7647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16175638#comment-16175638
]
ASF GitHub Bot commented on FLINK-7647:
---------------------------------------
Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/4691#discussion_r140380156
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/ClusterConfigHandler.java
---
@@ -33,20 +43,27 @@
/**
* Returns the Job Manager's configuration.
*/
-public class JobManagerConfigHandler extends AbstractJsonRequestHandler {
-
- private static final String JOBMANAGER_CONFIG_REST_PATH =
"/jobmanager/config";
+public class ClusterConfigHandler extends AbstractJsonRequestHandler
+ implements LegacyRestHandler<DispatcherGateway,
ClusterConfiguration, EmptyMessageParameters> {
private final Configuration config;
- public JobManagerConfigHandler(Executor executor, Configuration config)
{
+ public ClusterConfigHandler(Executor executor, Configuration config) {
super(executor);
- this.config = config;
+ this.config = Preconditions.checkNotNull(config);
}
@Override
public String[] getPaths() {
- return new String[]{JOBMANAGER_CONFIG_REST_PATH};
+ return new
String[]{ClusterConfigurationHeaders.CLUSTER_CONFIG_REST_PATH};
+ }
+
+ @Override
+ public CompletableFuture<ClusterConfiguration> handleRequest(
+ HandlerRequest<EmptyRequestBody,
EmptyMessageParameters> request,
+ DispatcherGateway gateway) {
+
+ return CompletableFuture.supplyAsync(() ->
ClusterConfiguration.from(config), executor);
--- End diff --
Maybe we could generate the `ClusterConfiguration` instance once at
creation time and then always return this element as a
`CompletableFuture.completedFuture(clusterConfiguration)`.
> Port JobManagerConfigHandler to new REST endpoint
> -------------------------------------------------
>
> Key: FLINK-7647
> URL: https://issues.apache.org/jira/browse/FLINK-7647
> Project: Flink
> Issue Type: Sub-task
> Components: REST, Webfrontend
> Reporter: Tzu-Li (Gordon) Tai
> Assignee: Tzu-Li (Gordon) Tai
> Labels: flip-6
> Fix For: 1.4.0
>
>
> Port existing {{JobManagerConfigHandler}} to new REST endpoint
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)