/** * Create tasks to manipulate the cache (Seed, truncate, etc) They will still need to be * dispatched. * * @param tr The range of tiles to work on. * @param type The type of task(s) to create * @param threadCount The number of threads to use, forced to 1 if type is TRUNCATE * @param filterUpdate // TODO: What does this do? * @return Array of tasks. Will have length threadCount or 1. * @throws GeoWebCacheException */ public GWCTask[] createTasks( TileRange tr, GWCTask.TYPE type, int threadCount, boolean filterUpdate) throws GeoWebCacheException { String layerName = tr.getLayerName(); TileLayer tileLayer = layerDispatcher.getTileLayer(layerName); return createTasks(tr, tileLayer, type, threadCount, filterUpdate); }
@Override public boolean delete(TileRange obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).delete(obj)); }
LOG.debug( "Removing TileObjects for Layer: " + obj.getLayerName() + ", min/max levels: " + "[" cacheProvider.removeLayer(obj.getLayerName()); + obj.getLayerName() + ", min/max levels: " + "["
int count = 0; String prefix = path + File.separator + filteredLayerName(trObj.getLayerName()); final String layerName = trObj.getLayerName(); final String gridSetId = trObj.getGridSetId(); final String blobFormat = trObj.getMimeType().getFormat();
/** * @return the key prefix up to the coordinates (i.e. {@code * "<prefix>/<layer>/<gridset>/<format>/<parametersId>"}) */ public String coordinatesPrefix(TileRange obj) { checkNotNull(obj.getLayerName()); checkNotNull(obj.getGridSetId()); checkNotNull(obj.getMimeType()); String layer = layerId(obj.getLayerName()); String gridset = obj.getGridSetId(); MimeType mimeType = obj.getMimeType(); String shortFormat; String parametersId = obj.getParametersId(); if (parametersId == null) { Map<String, String> parameters = obj.getParameters(); parametersId = ParametersUtils.getId(parameters); if (parametersId == null) { parametersId = "default"; } else { obj.setParametersId(parametersId); } } shortFormat = mimeType.getFileExtension(); // png, png8, png24, etc String key = join(true, prefix, layer, gridset, shortFormat, parametersId); return key; }
/** * @return the key prefix up to the coordinates (i.e. {@code * "<prefix>/<layer>/<gridset>/<format>/<parametersId>"}) */ public String coordinatesPrefix(TileRange obj) { checkNotNull(obj.getLayerName()); checkNotNull(obj.getGridSetId()); checkNotNull(obj.getMimeType()); String layer = layerId(obj.getLayerName()); String gridset = obj.getGridSetId(); MimeType mimeType = obj.getMimeType(); String shortFormat; String parametersId = obj.getParametersId(); if (parametersId == null) { Map<String, String> parameters = obj.getParameters(); parametersId = ParametersUtils.getId(parameters); if (parametersId == null) { parametersId = "default"; } else { obj.setParametersId(parametersId); } } shortFormat = mimeType.getFileExtension(); // png, png8, png24, etc String key = join(true, prefix, layer, gridset, shortFormat, parametersId); return key; }
/** * Create a filter for stored tiles that are within a particular range. * * @param trObj the range to find * @throws StorageException */ public FilePathFilter(TileRange trObj) throws StorageException { this.tr = trObj; if (tr.getGridSetId() == null) { throw new StorageException("Specifying the grid set id is currently mandatory."); } String layerName = tr.getLayerName(); Preconditions.checkNotNull(layerName); this.layerPrefix = filteredLayerName(layerName); gridSetPrefix = filteredGridSetId(tr.getGridSetId()); if (tr.getMimeType() != null) { mimeExtension = tr.getMimeType().getFileExtension(); } }
/** * Build the paths correspondent to a tile range. For each file we return the associated tiles * range by zoom. */ Map<File, List<long[]>> getFiles(TileRange tileRange) { Map<File, List<long[]>> files = new HashMap<>(); // let's iterate of all the available zoom levels for (int z = tileRange.getZoomStart(); z <= tileRange.getZoomStop(); z++) { long[] range = tileRange.rangeBounds(z); if (range == null) { // this zoom level doesn't have any tiles associated continue; } // get the files and associated tiles for the current zoom level getFiles( files, tileRange.getParametersId(), tileRange.getLayerName(), tileRange.getGridSetId(), tileRange.getMimeType().getFormat(), tileRange.getParameters(), z, range); } return files; }
/** * Build the paths correspondent to a tile range. For each file we return the associated tiles * range by zoom. */ Map<File, List<long[]>> getFiles(TileRange tileRange) { Map<File, List<long[]>> files = new HashMap<>(); // let's iterate of all the available zoom levels for (int z = tileRange.getZoomStart(); z <= tileRange.getZoomStop(); z++) { long[] range = tileRange.rangeBounds(z); if (range == null) { // this zoom level doesn't have any tiles associated continue; } // get the files and associated tiles for the current zoom level getFiles( files, tileRange.getParametersId(), tileRange.getLayerName(), tileRange.getGridSetId(), tileRange.getMimeType().getFormat(), tileRange.getParameters(), z, range); } return files; }
String layerName = tileRange.getLayerName(); String gridSetId = tileRange.getGridSetId(); String format = tileRange.getMimeType().getFormat();
String layerName = tileRange.getLayerName(); String gridSetId = tileRange.getGridSetId(); String format = tileRange.getMimeType().getFormat();