Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 63576200D56 for ; Mon, 6 Nov 2017 17:59:06 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 617A8160BD5; Mon, 6 Nov 2017 16:59:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A9167160BFF for ; Mon, 6 Nov 2017 17:59:05 +0100 (CET) Received: (qmail 4069 invoked by uid 500); 6 Nov 2017 16:59:04 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 4059 invoked by uid 99); 6 Nov 2017 16:59:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Nov 2017 16:59:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 2167B180857 for ; Mon, 6 Nov 2017 16:59:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id UZP8RAZC839P for ; Mon, 6 Nov 2017 16:59:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 5B9D75F3E0 for ; Mon, 6 Nov 2017 16:59:03 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 1B808E0E80 for ; Mon, 6 Nov 2017 16:59:03 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 60042241AE for ; Mon, 6 Nov 2017 16:59:00 +0000 (UTC) Date: Mon, 6 Nov 2017 16:59:00 +0000 (UTC) From: "Till Rohrmann (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (FLINK-8000) Sort REST handler URLs in RestServerEndpoint MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 06 Nov 2017 16:59:06 -0000 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)