Skip to content

Commit a9fcd18

Browse files
authored
Merge branch 'master' into geometries
2 parents 9e2e363 + 36db039 commit a9fcd18

File tree

7 files changed

+61
-23
lines changed

7 files changed

+61
-23
lines changed

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ xsom = '20140925'
44
aalto = '1.3.3'
55
staxmate = '2.4.1'
66
rxjava-jdbc = '0.1.4-ii.1'
7-
hikaricp = '7.0.1'
7+
hikaricp = '7.0.2'
88
postgresql = '42.7.7'
99
sqlite = '3.50.3.0'
10-
schemacrawler = '16.26.3'
10+
schemacrawler = '16.27.1'
1111
jsqlparser = '5.3'
1212
jts = '1.20.0'
1313
commonmark = '0.25.1'

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ buildscript {
2020
}
2121

2222
plugins {
23-
id "de.interactive_instruments.xtraplatform-settings" version "6.1.7"
23+
id "de.interactive_instruments.xtraplatform-settings" version "6.1.8"
2424
}
2525

2626
def versions = xtraplatform.getCatalogVersions(file("gradle/layers.versions.toml"))

xtraplatform-tiles/src/main/java/de/ii/xtraplatform/tiles/app/TileSeedingJobCreator.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,19 @@ public String getJobType() {
5959
return TileSeedingJobSet.TYPE_SETUP;
6060
}
6161

62+
@Override
63+
public int getPriority() {
64+
// should be higher than for the processors of the created jobs (VectorSeedingJobProcessor)
65+
return 1001;
66+
}
67+
6268
@Override
6369
public int getConcurrency(JobSet jobSet) {
6470
return concurrency;
6571
}
6672

6773
@Override
6874
public JobResult process(Job job, JobSet jobSet, Consumer<Job> pushJob) {
69-
7075
TileSeedingJobSet seedingJobSet = getSetDetails(jobSet);
7176
boolean isCleanup = getDetails(job);
7277

@@ -101,13 +106,11 @@ public JobResult process(Job job, JobSet jobSet, Consumer<Job> pushJob) {
101106
if (LOGGER.isInfoEnabled() || LOGGER.isInfoEnabled(MARKER.JOBS)) {
102107
LOGGER.info(
103108
MARKER.JOBS,
104-
"{} started (Tilesets: {})",
109+
"{} scheduled (Tilesets: {})",
105110
jobSet.getLabel(),
106111
seedingJobSet.getTileSets().keySet());
107112
}
108113

109-
jobSet.start();
110-
111114
Map<String, Map<String, Set<TileMatrixSetLimits>>> coverage =
112115
tileProvider.seeding().get().getCoverage(seedingJobSet.getTileSetParameters());
113116
Map<String, Map<String, Set<TileMatrixSetLimits>>> rasterCoverage =
@@ -173,6 +176,7 @@ public JobResult process(Job job, JobSet jobSet, Consumer<Job> pushJob) {
173176
Job job2 =
174177
isRaster
175178
? TileSeedingJob.raster(
179+
jobSet.getPriority(),
176180
tileProvider.getId(),
177181
tileSet,
178182
tileMatrixSet,
@@ -184,6 +188,7 @@ public JobResult process(Job job, JobSet jobSet, Consumer<Job> pushJob) {
184188
.get()
185189
.getRasterStorageInfo(tileSet, tileMatrixSet, subMatrix))
186190
: TileSeedingJob.of(
191+
jobSet.getPriority(),
187192
tileProvider.getId(),
188193
tileSet,
189194
tileMatrixSet,

xtraplatform-tiles/src/main/java/de/ii/xtraplatform/tiles/app/VectorSeedingJobProcessor.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ public String getJobType() {
4848
return TileSeedingJob.TYPE_MVT;
4949
}
5050

51+
@Override
52+
public int getPriority() {
53+
return 1000;
54+
}
55+
5156
@Override
5257
public int getConcurrency(JobSet jobSet) {
5358
return concurrency;

xtraplatform-tiles/src/main/java/de/ii/xtraplatform/tiles/domain/SeedingOptions.java

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,23 +117,19 @@ default boolean shouldPurge() {
117117
}
118118

119119
/**
120-
* @langEn The maximum number of threads the seeding is allowed to use. The actual number of
121-
* threads used depends on the number of available background task threads when the seeding is
122-
* about to start. If you want to allow more than thread, first check if sufficient background
123-
* task threads are configured. Take into account that the seeding for multiple APIs will
124-
* compete for the available background task threads.
125-
* @langDe Die maximale Anzahl an Threads, die für das Seeding verwendet werden darf. Die
126-
* tatsächlich verwendete Zahl der Threads hängt davon ab, wie viele Threads für
127-
* [Hintergrundprozesse](../../application/20-configuration/90-background-tasks.md) zur
128-
* Verfügung stehen, wenn das Seeding startet. Wenn mehr als ein Thread erlaubt sein soll, ist
129-
* zunächst zu prüfen, ob genügend Threads fürHintergrundprozesse konfiguriert sind. Es ist zu
130-
* berücksichtigen, dass alle APIs um die vorhandenen Threads für Hintergrundprozesse
131-
* konkurrieren.
120+
* @langEn *Deprecated* This option has no effect anymore. All available background task threads
121+
* will be used for seeding. You can control the order of execution by setting the `priority`
122+
* of the seeding job.
123+
* @langDe *Deprecated* Diese Option hat keine Auswirkung mehr. Alle verfügaren Threads für
124+
* Hintergrundprozesse werden für das Seeding verwendet. Die Reihenfolge der Ausführung kann
125+
* über die `priority` des Seeding-Jobs gesteuert werden.
132126
* @default 1
133127
*/
128+
@Deprecated(since = "v4.5", forRemoval = true)
134129
@Nullable
135130
Integer getMaxThreads();
136131

132+
@Deprecated(since = "v4.5", forRemoval = true)
137133
@Value.Lazy
138134
@JsonIgnore
139135
default int getEffectiveMaxThreads() {
@@ -156,4 +152,23 @@ default int getEffectiveMaxThreads() {
156152
default int getEffectiveJobSize() {
157153
return Objects.requireNonNullElse(getJobSize(), JobSize.M).getNumberOfTiles();
158154
}
155+
156+
/**
157+
* @langEn The priority of the seeding job. This controls the order in which this seeding job is
158+
* executed compared to other seeding jobs. A higher number means that the seeding job is
159+
* executed earlier.
160+
* @langDe Die Priorität des Seeding-Jobs. Diese steuert die Reihenfolge, in der dieser
161+
* Seeding-Job im Vergleich zu anderen Seeding-Jobs ausgeführt wird. Eine höhere Zahl
162+
* bedeutet, dass der Seeding-Job früher ausgeführt wird.
163+
* @since v4.5
164+
* @default 1000
165+
*/
166+
@Nullable
167+
Integer getPriority();
168+
169+
@Value.Lazy
170+
@JsonIgnore
171+
default int getEffectivePriority() {
172+
return Objects.requireNonNullElse(getPriority(), 1000);
173+
}
159174
}

xtraplatform-tiles/src/main/java/de/ii/xtraplatform/tiles/domain/TileSeedingJob.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public interface TileSeedingJob {
2525
String TYPE_PNG = TileSeedingJobSet.type("raster", "png");
2626

2727
static Job of(
28+
int priority,
2829
String tileProvider,
2930
String tileSet,
3031
String tileMatrixSet,
@@ -43,10 +44,11 @@ static Job of(
4344
.addAllSubMatrices(subMatrices)
4445
.build();
4546

46-
return Job.of(TYPE_MVT, details, jobSetId, (int) details.getNumberOfTiles());
47+
return Job.of(TYPE_MVT, priority, details, jobSetId, (int) details.getNumberOfTiles());
4748
}
4849

4950
static Job raster(
51+
int priority,
5052
String tileProvider,
5153
String tileSet,
5254
String tileMatrixSet,
@@ -65,7 +67,7 @@ static Job raster(
6567
.storage(storageInfo)
6668
.build();
6769

68-
return Job.of(TYPE_PNG, details, jobSetId, (int) details.getNumberOfTiles());
70+
return Job.of(TYPE_PNG, priority, details, jobSetId, (int) details.getNumberOfTiles());
6971
}
7072

7173
String getTileProvider();

xtraplatform-tiles/src/main/java/de/ii/xtraplatform/tiles/domain/TileSeedingJobSet.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,13 @@ static String type(String... parts) {
3434
}
3535

3636
static JobSet of(
37-
String tileProvider, Map<String, TileGenerationParameters> tileSets, boolean reseed) {
37+
String tileProvider,
38+
Map<String, TileGenerationParameters> tileSets,
39+
boolean reseed,
40+
int priority) {
3841
return JobSet.of(
3942
TYPE,
43+
priority,
4044
tileProvider,
4145
LABEL,
4246
String.format(" (Tilesets: %s)", tileSets.keySet()),
@@ -45,7 +49,7 @@ static JobSet of(
4549
.tileSets(TilesetDetails.of(tileSets))
4650
.isReseed(reseed)
4751
.build())
48-
.with(Job.of(TYPE_SETUP, false), Job.of(TYPE_SETUP, true));
52+
.with(Job.of(TYPE_SETUP, priority, false), Job.of(TYPE_SETUP, priority, true));
4953
}
5054

5155
static JobSet with(JobSet jobSet, Map<String, TileGenerationParameters> tileSets) {
@@ -61,6 +65,13 @@ static JobSet with(JobSet jobSet, Map<String, TileGenerationParameters> tileSets
6165

6266
Map<String, TilesetDetails> getTileSets();
6367

68+
@JsonIgnore
69+
@Value.Lazy
70+
@Override
71+
default String getLabel() {
72+
return "Tilesets: " + getTileSets().keySet();
73+
}
74+
6475
@JsonIgnore
6576
@Value.Lazy
6677
default Map<String, TileGenerationParameters> getTileSetParameters() {

0 commit comments

Comments
 (0)