Till Rohrmann created FLINK-8000:
------------------------------------

             Summary: Sort REST handler URLs in RestServerEndpoint
                 Key: FLINK-8000
                 URL: https://issues.apache.org/jira/browse/FLINK-8000
             Project: Flink
          Issue Type: Improvement
          Components: REST
    Affects Versions: 1.4.0
            Reporter: Till Rohrmann
            Assignee: Till Rohrmann
            Priority: Minor


In order to make the {{RestServerEndpoint}} more easily extendable, we should 
automatically sort the returned list of rest handler when calling 
{{RestServerEndpoint#initializeHandlers}}. That way the order in which the 
handlers are added to the list is independent of the actual registration order. 
This is, for example, important for the static file server which always needs 
to be registered last.

I propose to add a special {{String}} {{Comparator}} which considers the 
charactor {{':'}} to be the character with the largest value. That way we 
should get always the following sort order:

- URLs without path parameters have precedence over similar URLs where parts 
are replaced by path parameters (e.g. {{/jobs/overview}}, {{/jobs/:jobid}} and 
{{/jobs/:jobid/config}}, {{/jobs/:jobid/vertices/:vertexId}})
- Prefixes are sorted before URLs containing the prefix (e.g. {{/jobs}}, 
{{/jobs/overview}})



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to