Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ private TileStore getTileStore(
tileMatrixSets,
tileMatrixSetRepository,
partitions,
cache.getSeeded())
cache.getSeeded() && cache.getSeededOnly())
: new TileStorePlain(cacheStore);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static TileStore readWrite(
Map<String, Set<String>> tileMatrixSets,
Optional<TileMatrixSetRepository> tileMatrixSetRepository,
Optional<TileMatrixPartitions> partitions,
boolean seeded) {
boolean strictlySeeded) {
Map<String, MbtilesTileset> tileSets = new ConcurrentHashMap<>();
try {
for (String tileset : tileSchemas.keySet()) {
Expand All @@ -81,7 +81,7 @@ static TileStore readWrite(
getVectorLayers(tileSchemas, tileset),
partitions,
tileSchemas.get(tileset).isEmpty(),
seeded));
strictlySeeded));
}
}
} catch (IOException e) {
Expand Down Expand Up @@ -436,7 +436,7 @@ private static MbtilesTileset createTileSet(
List<VectorLayer> vectorLayers,
Optional<TileMatrixPartitions> partitions,
boolean isRaster,
boolean seeded)
boolean strictlySeeded)
throws IOException {
Path relPath =
Path.of(tileset).resolve(tileMatrixSet + (partitions.isEmpty() ? MBTILES_SUFFIX : ""));
Expand All @@ -461,15 +461,15 @@ private static MbtilesTileset createTileSet(
.build();

if (partitions.isPresent()) {
return new MbtilesTileset(filePath.get(), md, partitions, isRaster, seeded);
return new MbtilesTileset(filePath.get(), md, partitions, isRaster, strictlySeeded);
}

if (rootStore.has(relPath)) {
return new MbtilesTileset(filePath.get(), isRaster);
}

try {
return new MbtilesTileset(filePath.get(), md, Optional.empty(), isRaster, seeded);
return new MbtilesTileset(filePath.get(), md, Optional.empty(), isRaster, strictlySeeded);
} catch (FileAlreadyExistsException e) {
throw new IllegalStateException(
"A MBTiles file already exists. It must have been created by a parallel thread, which should not occur. MBTiles file creation must be synchronized.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ default boolean getSeeded() {
return true;
}

/**
* @langEn Should this cache be exclusively used by the [Seeding](#seeding)?
* @langDe Soll dieser Cache ausschließlich beim [Seeding](#seeding) verwendet werden?
* @default false
* @since v4.6
*/
@Value.Default
default boolean getSeededOnly() {
return false;
}

/**
* @langEn Tiling schemes and zoom levels that should be stored in the cache. Applies to all
* tilesets that are not specified in `tilesetLevels`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ public MbtilesTileset(
MbtilesMetadata metadata,
Optional<TileMatrixPartitions> partitions,
boolean isRaster,
boolean seeded)
boolean strictlySeeded)
throws IOException {
this(
tilesetPath,
metadata,
partitions,
isRaster,
false,
partitions.isPresent() && seeded && isRaster ? Mutex.createNoOp() : Mutex.create());
partitions.isPresent() && strictlySeeded ? Mutex.createNoOp() : Mutex.create());
}

private MbtilesTileset(
Expand Down