From fa0bd3531bab90f76dadb3d438794bd26056af91 Mon Sep 17 00:00:00 2001 From: Daniele Romagnoli Date: Tue, 16 Jul 2024 11:58:25 +0200 Subject: [PATCH] GEOS-11471:Removing sharding --- doc/en/user/source/extensions/mapml/index.rst | 26 +-------- .../org/geoserver/mapml/MapMLConstants.java | 9 --- .../geoserver/mapml/MapMLDocumentBuilder.java | 56 ------------------- .../mapml/MapMLLayerConfigurationPanel.html | 32 ----------- .../mapml/MapMLLayerConfigurationPanel.java | 23 -------- .../MapMLLayerGroupConfigurationPanel.html | 23 -------- .../MapMLLayerGroupConfigurationPanel.java | 20 ------- .../java/org/geoserver/mapml/xml/Input.java | 23 -------- .../resources/GeoServerApplication.properties | 8 --- .../GeoServerApplication_fr.properties | 8 --- .../GeoServerApplication_ko.properties | 8 --- .../GeoServerApplication_ro.properties | 8 --- .../mapml/src/main/resources/schema/mapml.rnc | 1 - .../mapml/src/main/resources/schema/mapml.xsd | 1 - .../MapMLLayerConfigurationPanelTest.java | 19 ------- .../org/geoserver/mapml/MapMLWMSTest.java | 23 ++++---- 16 files changed, 13 insertions(+), 275 deletions(-) diff --git a/doc/en/user/source/extensions/mapml/index.rst b/doc/en/user/source/extensions/mapml/index.rst index adda4c9c962..9232caa9517 100644 --- a/doc/en/user/source/extensions/mapml/index.rst +++ b/doc/en/user/source/extensions/mapml/index.rst @@ -209,31 +209,7 @@ in order to enable WMTS requests. .. figure:: images/mapml_tile_caching_panel_ui.png -Sharding Config -^^^^^^^^^^^^^^^^ - -The Sharding Config options are intended to allow for parallel access to tiles via different server names. The actual server names must be configured in the DNS to refer to either the same server or different servers with the same GeSserver layer configuration. In the example above, the mapML client would alternate between the servers a.geoserver.org, b.geoserver.org, and c.geoserver.org to access the map images. The values in the example above would result in the following MapML: - -.. code-block:: html - - - - - - - -**Enable Sharding** - If Enable Sharding is checked, and values are provided for the Shard List and Shard Server Pattern fields, then a hidden shard list input will be included in the MapML. - -**Shard List** - If Enable Sharding is checked, the Shard List should be populated with a comma-separated list of shard names which will be used to populate the shard data list element. - -**Shard Server Pattern** - The Shard Server Pattern should be a valid DNS name including the special placeholder string {s} which will be replace with the Shard Names from the Shard List in requests to the server. This pattern should not include any slashes, the protocol string (http://) or the port number (:80), as these are all determined automatically from the URL used to access the MapML resource. - +Starting with version 2.26.x of GeoServer, Sharding support and related configuration has been removed. Dimension Config ^^^^^^^^^^^^^^^^ diff --git a/src/extension/mapml/src/main/java/org/geoserver/mapml/MapMLConstants.java b/src/extension/mapml/src/main/java/org/geoserver/mapml/MapMLConstants.java index 33bd62ce64a..91e20044508 100644 --- a/src/extension/mapml/src/main/java/org/geoserver/mapml/MapMLConstants.java +++ b/src/extension/mapml/src/main/java/org/geoserver/mapml/MapMLConstants.java @@ -78,12 +78,6 @@ public final class MapMLConstants { /** MAPML_DIMENSION */ public static final String MAPML_MIME = MAPML_PREFIX + MIME; - /** SHARD_LIST */ - public static final String SHARD_LIST = "shardList"; - - /** ENABLE_SHARDING */ - public static final String ENABLE_SHARDING = "enableSharding"; - /** USE_TILES */ public static final String USE_TILES = "useTiles"; @@ -96,9 +90,6 @@ public final class MapMLConstants { /** USE_FEATURES */ public static final String USE_FEATURES = "useFeatures"; - /** SHARD_SERVER_PATTERN */ - public static final String SHARD_SERVER_PATTERN = "shardServerPattern"; - /** LICENSE_TITLE */ public static final String LICENSE_TITLE = "mapml.licenseTitle"; diff --git a/src/extension/mapml/src/main/java/org/geoserver/mapml/MapMLDocumentBuilder.java b/src/extension/mapml/src/main/java/org/geoserver/mapml/MapMLDocumentBuilder.java index aabff59fbaf..438a8088b41 100644 --- a/src/extension/mapml/src/main/java/org/geoserver/mapml/MapMLDocumentBuilder.java +++ b/src/extension/mapml/src/main/java/org/geoserver/mapml/MapMLDocumentBuilder.java @@ -50,7 +50,6 @@ import org.geoserver.mapml.xml.AxisType; import org.geoserver.mapml.xml.Base; import org.geoserver.mapml.xml.BodyContent; -import org.geoserver.mapml.xml.Datalist; import org.geoserver.mapml.xml.Extent; import org.geoserver.mapml.xml.HeadContent; import org.geoserver.mapml.xml.Input; @@ -134,8 +133,6 @@ public class MapMLDocumentBuilder { private String imageFormat = DEFAULT_MIME_TYPE; private String baseUrl; private String baseUrlPattern; - private Boolean enableSharding; - private String[] shardArray; private ProjType projType; private MetadataMap layerMeta; private int height; @@ -331,23 +328,6 @@ public void initialize() throws ServiceException { imageFormat = (String) format.orElse(mapMLLayerMetadata.getDefaultMimeType()); baseUrl = ResponseUtils.baseURL(request); baseUrlPattern = baseUrl; - // handle shard config - enableSharding = layerMeta.get("mapml.enableSharding", Boolean.class); - String shardListString = layerMeta.get("mapml.shardList", String.class); - shardArray = new String[0]; - if (shardListString != null) { - shardArray = shardListString.split("[,\\s]+"); - } - String shardServerPattern = layerMeta.get("mapml.shardServerPattern", String.class); - if (shardArray.length < 1 - || shardServerPattern == null - || shardServerPattern.isEmpty()) { - enableSharding = Boolean.FALSE; - } - // if we have a valid shard config - if (Boolean.TRUE.equals(enableSharding)) { - baseUrlPattern = shardBaseURL(request, shardServerPattern); - } } } @@ -685,22 +665,6 @@ public String getTitle(PublishedInfo p, String defaultTitle) { } } - /** - * @param req the request - * @param shardServerPattern the shard server pattern - * @return the shard base URL - */ - private String shardBaseURL(HttpServletRequest req, String shardServerPattern) { - StringBuffer sb = new StringBuffer(req.getScheme()); - sb.append("://") - .append(shardServerPattern) - .append(":") - .append(req.getServerPort()) - .append(req.getContextPath()) - .append("/"); - return sb.toString(); - } - /** Create and return MapML document */ private void prepareDocument() { // build the mapML doc @@ -998,26 +962,6 @@ private List prepareExtents() throws IOException { extentZoomInput.setMax(maxZoom); extentList.add(extentZoomInput); - Input input; - // shard list - if (Boolean.TRUE.equals(enableSharding)) { - input = new Input(); - input.setName("s"); - input.setType(InputType.HIDDEN); - input.setShard("true"); - input.setList("servers"); - extentList.add(input); - Datalist datalist = new Datalist(); - datalist.setId("servers"); - List