Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream merge 2025-01-10 #243

Merged
merged 89 commits into from
Jan 13, 2025
Merged
Changes from 29 commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
12b4995
make all polling updater wait for graph update finish
miklcct Nov 19, 2024
5edfd73
Merge branch 'dev-2.x' into fix-update-lag
miklcct Nov 26, 2024
ed778da
Merge branch 'dev-2.x' into fix-update-lag
miklcct Nov 27, 2024
901f96a
Add SIRI light
leonardehrenfried Nov 20, 2024
1b824ac
Update logger name
leonardehrenfried Nov 26, 2024
9eed5be
Improve documentation
leonardehrenfried Nov 26, 2024
96b8f1e
Update docs
leonardehrenfried Nov 26, 2024
8fdebbb
Make spelling of SIRI consistent across docs
leonardehrenfried Nov 27, 2024
af138ab
Add metrics to SIRI light
leonardehrenfried Nov 27, 2024
240c70e
Add SIRI SX
leonardehrenfried Nov 27, 2024
24bcf97
Add documentation about SIRI SX
leonardehrenfried Nov 27, 2024
464ca30
Move config interfaces into updaters
leonardehrenfried Nov 27, 2024
0124153
Small cleanup of the SIRI code
leonardehrenfried Nov 27, 2024
30e12f9
Add test and example
leonardehrenfried Nov 27, 2024
6703d62
Skip updater in main docs
leonardehrenfried Nov 27, 2024
86a447f
Change spelling from 'Light' to 'Lite'
leonardehrenfried Dec 4, 2024
f7e30ec
Change package name
leonardehrenfried Dec 4, 2024
ee0e79d
More spelling correction
leonardehrenfried Dec 4, 2024
c74c9e5
Merge branch 'dev-2.x' into fix-update-lag
miklcct Dec 4, 2024
be21d1a
Fix spelling of 'Lite'
leonardehrenfried Dec 9, 2024
6e17055
Update application/src/main/java/org/opentripplanner/updater/siri/upd…
leonardehrenfried Dec 11, 2024
4974223
Update application/src/main/java/org/opentripplanner/updater/siri/upd…
leonardehrenfried Dec 11, 2024
ed76a4d
Don't use getClass()
leonardehrenfried Dec 11, 2024
3b06b85
Use shorter name for parameters
leonardehrenfried Dec 11, 2024
71fae3d
Use shorter name for SIRI-SX
leonardehrenfried Dec 11, 2024
790bdc6
Build SIRI loader in factory, inject into source
leonardehrenfried Dec 11, 2024
ebcaca2
Merge remote-tracking branch 'upstream/dev-2.x' into siri-light
leonardehrenfried Dec 11, 2024
ec9e724
Fix spelling of SIRI-ET
leonardehrenfried Dec 11, 2024
0944921
extract future handling logic to a new method
miklcct Dec 12, 2024
4df65a1
add feature flag
miklcct Dec 12, 2024
d8a34dd
refactor update graph logic to PollingGraphUpdater
miklcct Dec 12, 2024
69ac485
add test for desired feature flag
miklcct Dec 12, 2024
0037b5a
implement feature flag
miklcct Dec 12, 2024
defdf5f
Introduce factory
leonardehrenfried Dec 13, 2024
2ce1a6d
Merge branch 'dev-2.x' into fix-update-lag
miklcct Dec 17, 2024
fd0b1fe
Update protobuf, OSM parser and Google cloud tools
leonardehrenfried Dec 17, 2024
de1e23d
Re-enable file loader for SIRI-SX
leonardehrenfried Dec 18, 2024
5cc6812
Specify version in parent pom
leonardehrenfried Dec 19, 2024
48ccd36
fix(deps): update dependency org.entur:siri-java-model to v1.28
renovate[bot] Dec 20, 2024
7f4ee90
fix(deps): update lucene.version to v10
renovate[bot] Jan 1, 2025
9a3fec8
Update code to Lucene 10
leonardehrenfried Jan 3, 2025
1518e38
Apply review feedback
leonardehrenfried Jan 3, 2025
df53a35
Merge pull request #6284 from leonardehrenfried/siri-light
leonardehrenfried Jan 3, 2025
509094c
Add changelog entry for #6284 [ci skip]
Jan 3, 2025
249b01b
Update list of GTFS Fares v2 classes
leonardehrenfried Jan 3, 2025
21f15bd
Update to latest OBA
leonardehrenfried Jan 3, 2025
c0f7a3f
Merge branch 'dev-2.x' into fix-update-lag
miklcct Jan 7, 2025
af5fe63
Merge pull request #6347 from opentripplanner/renovate/siri-java-mode…
vpaturet Jan 7, 2025
5d4911b
fix(deps): update micrometer to v1.14.2
renovate[bot] Jan 7, 2025
f3ed454
Merge remote-tracking branch 'upstream/dev-2.x' into upgrade-protobuf
leonardehrenfried Jan 7, 2025
d61504a
Merge pull request #6364 from opentripplanner/renovate/micrometer
vpaturet Jan 7, 2025
fb9bad6
Merge remote-tracking branch 'upstream/dev-2.x' into upgrade-protobuf
leonardehrenfried Jan 7, 2025
51080a8
fix(deps): update dependency com.google.guava:guava to v33.4.0-jre
renovate[bot] Jan 7, 2025
72019c0
Add a matcher API for filters in the transit service used for regular…
eibakke Jan 7, 2025
1ebb855
Add changelog entry for #6234 [ci skip]
Jan 7, 2025
f8b51d9
Fix spelling of SIRI [ci skip]
leonardehrenfried Jan 8, 2025
0fb152d
Merge pull request #6354 from opentripplanner/renovate/major-lucene.v…
leonardehrenfried Jan 9, 2025
1bfc833
Fix ScheduledTransitAlertBuilder
leonardehrenfried Jan 8, 2025
665a2d2
Merge remote-tracking branch 'upstream/dev-2.x' into upgrade-protobuf
leonardehrenfried Jan 9, 2025
74241bd
Merge branch 'dev-2.x' into fix-update-lag
miklcct Jan 9, 2025
e439f87
Merge pull request #6366 from opentripplanner/renovate/guava-monorepo
vpaturet Jan 9, 2025
b0b8661
Merge pull request #6262 from Jnction/fix-update-lag
t2gran Jan 9, 2025
7163f6a
Add changelog entry for #6262 [ci skip]
Jan 9, 2025
be21661
Merge pull request #6358 from leonardehrenfried/faresv2-classes
leonardehrenfried Jan 9, 2025
2bf1fde
Merge remote-tracking branch 'upstream/dev-2.x' into upgrade-protobuf
leonardehrenfried Jan 9, 2025
98d8fd8
Remove unused import
leonardehrenfried Jan 9, 2025
f53245f
Fix formatting
leonardehrenfried Jan 9, 2025
0b8b82b
Merge pull request #6342 from leonardehrenfried/upgrade-protobuf
leonardehrenfried Jan 9, 2025
81d6c9b
fix(deps): update jersey monorepo to v3.1.10
renovate[bot] Jan 9, 2025
ffa99ab
Automerge patch version of jersey [ci skip]
leonardehrenfried Jan 9, 2025
969fb44
Merge pull request #6369 from opentripplanner/renovate/jersey-monorepo
leonardehrenfried Jan 9, 2025
edc3a7f
Automerge protobuf only once a month [ci skip]
leonardehrenfried Jan 9, 2025
c5d1183
Move TestDataFetcherDecorator to correct package path
cedarbaum Jan 10, 2025
872dbb3
Add explicit cast when calling createFromDocumentedEnum
cedarbaum Jan 10, 2025
e23144b
Add type annotation to OccupancyStatus instead of explicit cast
cedarbaum Jan 10, 2025
025e4c4
Merge pull request #6374 from cedarbaum/fix_lsp_errors
leonardehrenfried Jan 10, 2025
6a540d1
Remove testower from reviewers of jersey [ci skip]
leonardehrenfried Jan 10, 2025
86bb4b8
Merge remote-tracking branch 'upstream/dev-2.x' into upstream-merge-2…
leonardehrenfried Jan 10, 2025
35482d5
Re-enable Denver smoke tests
leonardehrenfried Jan 10, 2025
7dc4986
Skip SEPTA smoke tests
leonardehrenfried Jan 10, 2025
1eb0556
chore(deps): update dependency jsdom to v26
renovate[bot] Jan 10, 2025
8e1da42
Fix SEPTA smoke test
leonardehrenfried Jan 10, 2025
953d6c0
Merge pull request #6376 from opentripplanner/renovate/jsdom-26.x
leonardehrenfried Jan 10, 2025
77e2908
fix(deps): update debug ui dependencies (non-major)
renovate[bot] Jan 10, 2025
b297d9a
Merge pull request #6359 from opentripplanner/renovate/debug-ui-depen…
leonardehrenfried Jan 11, 2025
71bb5fa
Upgrade debug client to version 2025/01/2025-01-11T19:23
Jan 11, 2025
5d02122
Merge pull request #6368 from leonardehrenfried/fix-alerts
leonardehrenfried Jan 13, 2025
0312487
Add changelog entry for #6368 [ci skip]
Jan 13, 2025
53249fb
Merge remote-tracking branch 'upstream/dev-2.x' into upstream-merge-2…
leonardehrenfried Jan 13, 2025
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
@@ -8,7 +8,9 @@
import static org.opentripplanner.standalone.config.routerconfig.UpdatersConfig.Type.SIRI_AZURE_ET_UPDATER;
import static org.opentripplanner.standalone.config.routerconfig.UpdatersConfig.Type.SIRI_AZURE_SX_UPDATER;
import static org.opentripplanner.standalone.config.routerconfig.UpdatersConfig.Type.SIRI_ET_GOOGLE_PUBSUB_UPDATER;
import static org.opentripplanner.standalone.config.routerconfig.UpdatersConfig.Type.SIRI_ET_LITE;
import static org.opentripplanner.standalone.config.routerconfig.UpdatersConfig.Type.SIRI_ET_UPDATER;
import static org.opentripplanner.standalone.config.routerconfig.UpdatersConfig.Type.SIRI_SX_LITE;
import static org.opentripplanner.standalone.config.routerconfig.UpdatersConfig.Type.SIRI_SX_UPDATER;
import static org.opentripplanner.standalone.config.routerconfig.UpdatersConfig.Type.STOP_TIME_UPDATER;
import static org.opentripplanner.standalone.config.routerconfig.UpdatersConfig.Type.VEHICLE_PARKING;
@@ -30,7 +32,9 @@
import org.opentripplanner.standalone.config.routerconfig.updaters.MqttGtfsRealtimeUpdaterConfig;
import org.opentripplanner.standalone.config.routerconfig.updaters.PollingTripUpdaterConfig;
import org.opentripplanner.standalone.config.routerconfig.updaters.SiriETGooglePubsubUpdaterConfig;
import org.opentripplanner.standalone.config.routerconfig.updaters.SiriETLiteUpdaterConfig;
import org.opentripplanner.standalone.config.routerconfig.updaters.SiriETUpdaterConfig;
import org.opentripplanner.standalone.config.routerconfig.updaters.SiriSXLiteUpdaterConfig;
import org.opentripplanner.standalone.config.routerconfig.updaters.SiriSXUpdaterConfig;
import org.opentripplanner.standalone.config.routerconfig.updaters.VehicleParkingUpdaterConfig;
import org.opentripplanner.standalone.config.routerconfig.updaters.VehiclePositionsUpdaterConfig;
@@ -44,6 +48,8 @@
import org.opentripplanner.updater.siri.updater.SiriETUpdaterParameters;
import org.opentripplanner.updater.siri.updater.SiriSXUpdaterParameters;
import org.opentripplanner.updater.siri.updater.google.SiriETGooglePubsubUpdaterParameters;
import org.opentripplanner.updater.siri.updater.lite.SiriETLiteUpdaterParameters;
import org.opentripplanner.updater.siri.updater.lite.SiriSXLiteUpdaterParameters;
import org.opentripplanner.updater.trip.MqttGtfsRealtimeUpdaterParameters;
import org.opentripplanner.updater.trip.PollingTripUpdaterParameters;
import org.opentripplanner.updater.vehicle_parking.VehicleParkingUpdaterParameters;
@@ -182,6 +188,16 @@ public List<SiriSXUpdaterParameters> getSiriSXUpdaterParameters() {
return getParameters(SIRI_SX_UPDATER);
}

@Override
public List<SiriETLiteUpdaterParameters> getSiriETLiteUpdaterParameters() {
return getParameters(SIRI_ET_LITE);
}

@Override
public List<SiriSXLiteUpdaterParameters> getSiriSXLiteUpdaterParameters() {
return getParameters(SIRI_SX_LITE);
}

@Override
public List<MqttGtfsRealtimeUpdaterParameters> getMqttGtfsRealtimeUpdaterParameters() {
return getParameters(MQTT_GTFS_RT_UPDATER);
@@ -218,8 +234,10 @@ public enum Type {
REAL_TIME_ALERTS(GtfsRealtimeAlertsUpdaterConfig::create),
VEHICLE_POSITIONS(VehiclePositionsUpdaterConfig::create),
SIRI_ET_UPDATER(SiriETUpdaterConfig::create),
SIRI_ET_LITE(SiriETLiteUpdaterConfig::create),
SIRI_ET_GOOGLE_PUBSUB_UPDATER(SiriETGooglePubsubUpdaterConfig::create),
SIRI_SX_UPDATER(SiriSXUpdaterConfig::create),
SIRI_SX_LITE(SiriSXLiteUpdaterConfig::create),
SIRI_AZURE_ET_UPDATER(SiriAzureETUpdaterConfig::create),
SIRI_AZURE_SX_UPDATER(SiriAzureSXUpdaterConfig::create);

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package org.opentripplanner.standalone.config.routerconfig.updaters;

import static org.opentripplanner.standalone.config.framework.json.OtpVersion.V2_7;

import java.time.Duration;
import org.opentripplanner.standalone.config.framework.json.NodeAdapter;
import org.opentripplanner.updater.siri.updater.lite.SiriETLiteUpdaterParameters;

public class SiriETLiteUpdaterConfig {

public static SiriETLiteUpdaterParameters create(String configRef, NodeAdapter c) {
return new SiriETLiteUpdaterParameters(
configRef,
c.of("feedId").since(V2_7).summary("The ID of the feed to apply the updates to.").asString(),
c
.of("url")
.since(V2_7)
.summary("The URL to send the HTTP requests to.")
.description(SiriSXUpdaterConfig.URL_DESCRIPTION)
.asUri(),
c
.of("frequency")
.since(V2_7)
.summary("How often the updates should be retrieved.")
.asDuration(Duration.ofMinutes(1)),
c
.of("timeout")
.since(V2_7)
.summary("The HTTP timeout to download the updates.")
.asDuration(Duration.ofSeconds(15)),
c
.of("fuzzyTripMatching")
.since(V2_7)
.summary("If the fuzzy trip matcher should be used to match trips.")
.asBoolean(false),
HttpHeadersConfig.headers(c, V2_7)
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package org.opentripplanner.standalone.config.routerconfig.updaters;

import static org.opentripplanner.standalone.config.framework.json.OtpVersion.V2_0;
import static org.opentripplanner.standalone.config.framework.json.OtpVersion.V2_7;

import java.time.Duration;
import org.opentripplanner.standalone.config.framework.json.NodeAdapter;
import org.opentripplanner.updater.siri.updater.lite.SiriSXLiteUpdaterParameters;

public class SiriSXLiteUpdaterConfig {

public static SiriSXLiteUpdaterParameters create(String configRef, NodeAdapter c) {
return new SiriSXLiteUpdaterParameters(
configRef,
c.of("feedId").since(V2_7).summary("The ID of the feed to apply the updates to.").asString(),
c
.of("url")
.since(V2_7)
.summary("The URL to send the HTTP requests to.")
.description(SiriSXUpdaterConfig.URL_DESCRIPTION)
.asUri(),
c
.of("frequency")
.since(V2_7)
.summary("How often the updates should be retrieved.")
.asDuration(Duration.ofMinutes(1)),
c
.of("timeout")
.since(V2_7)
.summary("The HTTP timeout to download the updates.")
.asDuration(Duration.ofSeconds(15)),
c
.of("earlyStart")
.since(V2_0)
.summary("This value is subtracted from the actual validity defined in the message.")
.description(
"""
Normally the planned departure time is used, so setting this to 10s will cause the
SX-message to be included in trip-results 10 seconds before the the planned departure
time."""
)
.asDuration(Duration.ZERO),
HttpHeadersConfig.headers(c, V2_7)
);
}
}
Original file line number Diff line number Diff line change
@@ -8,6 +8,8 @@
import org.opentripplanner.updater.siri.updater.SiriETUpdaterParameters;
import org.opentripplanner.updater.siri.updater.SiriSXUpdaterParameters;
import org.opentripplanner.updater.siri.updater.google.SiriETGooglePubsubUpdaterParameters;
import org.opentripplanner.updater.siri.updater.lite.SiriETLiteUpdaterParameters;
import org.opentripplanner.updater.siri.updater.lite.SiriSXLiteUpdaterParameters;
import org.opentripplanner.updater.trip.MqttGtfsRealtimeUpdaterParameters;
import org.opentripplanner.updater.trip.PollingTripUpdaterParameters;
import org.opentripplanner.updater.vehicle_parking.VehicleParkingUpdaterParameters;
@@ -33,6 +35,10 @@ public interface UpdatersParameters {

List<SiriSXUpdaterParameters> getSiriSXUpdaterParameters();

List<SiriETLiteUpdaterParameters> getSiriETLiteUpdaterParameters();

List<SiriSXLiteUpdaterParameters> getSiriSXLiteUpdaterParameters();

List<MqttGtfsRealtimeUpdaterParameters> getMqttGtfsRealtimeUpdaterParameters();

List<VehicleParkingUpdaterParameters> getVehicleParkingUpdaterParameters();
Original file line number Diff line number Diff line change
@@ -20,9 +20,11 @@
import org.opentripplanner.updater.UpdatersParameters;
import org.opentripplanner.updater.alert.GtfsRealtimeAlertsUpdater;
import org.opentripplanner.updater.siri.SiriTimetableSnapshotSource;
import org.opentripplanner.updater.siri.updater.SiriETUpdater;
import org.opentripplanner.updater.siri.updater.SiriHttpLoader;
import org.opentripplanner.updater.siri.updater.SiriSXUpdater;
import org.opentripplanner.updater.siri.updater.configure.SiriUpdaterModule;
import org.opentripplanner.updater.siri.updater.google.SiriETGooglePubsubUpdater;
import org.opentripplanner.updater.siri.updater.lite.SiriLiteHttpLoader;
import org.opentripplanner.updater.spi.GraphUpdater;
import org.opentripplanner.updater.spi.TimetableSnapshotFlush;
import org.opentripplanner.updater.trip.MqttGtfsRealtimeUpdater;
@@ -182,13 +184,23 @@ private List<GraphUpdater> createUpdatersFromConfig() {
updaters.add(new PollingVehiclePositionUpdater(configItem, realtimeVehicleRepository));
}
for (var configItem : updatersParameters.getSiriETUpdaterParameters()) {
updaters.add(new SiriETUpdater(configItem, provideSiriTimetableSnapshot()));
updaters.add(
SiriUpdaterModule.createSiriETUpdater(configItem, provideSiriTimetableSnapshot())
);
}
for (var configItem : updatersParameters.getSiriETLiteUpdaterParameters()) {
updaters.add(
SiriUpdaterModule.createSiriETUpdater(configItem, provideSiriTimetableSnapshot())
);
}
for (var configItem : updatersParameters.getSiriETGooglePubsubUpdaterParameters()) {
updaters.add(new SiriETGooglePubsubUpdater(configItem, provideSiriTimetableSnapshot()));
}
for (var configItem : updatersParameters.getSiriSXUpdaterParameters()) {
updaters.add(new SiriSXUpdater(configItem, timetableRepository));
updaters.add(SiriUpdaterModule.createSiriSXUpdater(configItem, timetableRepository));
}
for (var configItem : updatersParameters.getSiriSXLiteUpdaterParameters()) {
updaters.add(SiriUpdaterModule.createSiriSXUpdater(configItem, timetableRepository));
}
for (var configItem : updatersParameters.getMqttGtfsRealtimeUpdaterParameters()) {
updaters.add(new MqttGtfsRealtimeUpdater(configItem, provideGtfsTimetableSnapshot()));
Original file line number Diff line number Diff line change
@@ -23,6 +23,4 @@ public interface EstimatedTimetableSource {
* {@link UpdateIncrementality}
*/
UpdateIncrementality incrementalityOfLastUpdates();

String getFeedId();
}
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
import org.opentripplanner.framework.io.OtpHttpClientException;
import org.opentripplanner.updater.spi.HttpHeaders;
import org.opentripplanner.updater.trip.UpdateIncrementality;
import org.opentripplanner.utils.tostring.ToStringBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import uk.org.siri.siri20.Siri;
@@ -19,11 +20,6 @@ public class SiriETHttpTripUpdateSource implements EstimatedTimetableSource {

private static final Logger LOG = LoggerFactory.getLogger(SiriETHttpTripUpdateSource.class);

/**
* Feed id that is used to match trip ids in the TripUpdates
*/
private final String feedId;

private final String url;

private final SiriLoader siriLoader;
@@ -35,16 +31,15 @@ public class SiriETHttpTripUpdateSource implements EstimatedTimetableSource {
private UpdateIncrementality updateIncrementality = FULL_DATASET;
private ZonedDateTime lastTimestamp = ZonedDateTime.now().minusMonths(1);

public SiriETHttpTripUpdateSource(Parameters parameters) {
this.feedId = parameters.feedId();
public SiriETHttpTripUpdateSource(Parameters parameters, SiriLoader siriLoader) {
this.url = parameters.url();

this.requestorRef =
parameters.requestorRef() == null || parameters.requestorRef().isEmpty()
? "otp-" + UUID.randomUUID()
: parameters.requestorRef();

this.siriLoader = createLoader(url, parameters);
this.siriLoader = siriLoader;
}

@Override
@@ -82,28 +77,8 @@ public UpdateIncrementality incrementalityOfLastUpdates() {
}

@Override
public String getFeedId() {
return this.feedId;
}

public String toString() {
return "SiriETHttpTripUpdateSource(" + url + ")";
}

private static SiriLoader createLoader(String url, Parameters parameters) {
// Load real-time updates from a file.
if (SiriFileLoader.matchesUrl(url)) {
return new SiriFileLoader(url);
}
// Fallback to default loader
else {
return new SiriHttpLoader(
url,
parameters.timeout(),
parameters.httpRequestHeaders(),
parameters.previewInterval()
);
}
return ToStringBuilder.of(SiriETHttpTripUpdateSource.class).addStr("url", url).toString();
}

public interface Parameters {
Original file line number Diff line number Diff line change
@@ -4,10 +4,12 @@
import java.util.function.Consumer;
import org.opentripplanner.updater.siri.SiriTimetableSnapshotSource;
import org.opentripplanner.updater.spi.PollingGraphUpdater;
import org.opentripplanner.updater.spi.PollingGraphUpdaterParameters;
import org.opentripplanner.updater.spi.ResultLogger;
import org.opentripplanner.updater.spi.UpdateResult;
import org.opentripplanner.updater.spi.WriteToGraphCallback;
import org.opentripplanner.updater.trip.metrics.TripUpdateMetrics;
import org.opentripplanner.updater.trip.UrlUpdaterParameters;
import org.opentripplanner.utils.tostring.ToStringBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import uk.org.siri.siri20.EstimatedTimetableDeliveryStructure;
@@ -31,30 +33,27 @@ public class SiriETUpdater extends PollingGraphUpdater {

private final EstimatedTimetableHandler estimatedTimetableHandler;

private final Consumer<UpdateResult> recordMetrics;
private final Consumer<UpdateResult> metricsConsumer;

public SiriETUpdater(
SiriETUpdaterParameters config,
SiriTimetableSnapshotSource timetableSnapshotSource
Parameters config,
SiriTimetableSnapshotSource timetableSnapshotSource,
EstimatedTimetableSource source,
Consumer<UpdateResult> metricsConsumer
) {
super(config);
// Create update streamer from preferences
this.feedId = config.feedId();

this.updateSource = new SiriETHttpTripUpdateSource(config.sourceParameters());
this.updateSource = source;

this.blockReadinessUntilInitialized = config.blockReadinessUntilInitialized();

LOG.info(
"Creating stop time updater (SIRI ET) running every {} seconds : {}",
pollingPeriod(),
updateSource
);
LOG.info("Creating SIRI-ET updater running every {}: {}", pollingPeriod(), updateSource);

estimatedTimetableHandler =
new EstimatedTimetableHandler(timetableSnapshotSource, config.fuzzyTripMatching(), feedId);

recordMetrics = TripUpdateMetrics.streaming(config);
this.metricsConsumer = metricsConsumer;
}

/**
@@ -78,7 +77,7 @@ public void runPolling() {
saveResultOnGraph.execute(context -> {
var result = estimatedTimetableHandler.applyUpdate(etds, incrementality, context);
ResultLogger.logUpdateResult(feedId, "siri-et", result);
recordMetrics.accept(result);
metricsConsumer.accept(result);
if (markPrimed) {
primed = true;
}
@@ -88,8 +87,20 @@ public void runPolling() {
} while (moreData);
}

@Override
public String toString() {
String s = (updateSource == null) ? "NONE" : updateSource.toString();
return "Polling SIRI ET updater with update source = " + s;
return ToStringBuilder
.of(SiriETUpdater.class)
.addStr("source", updateSource.toString())
.addDuration("frequency", pollingPeriod())
.toString();
}

public interface Parameters extends UrlUpdaterParameters, PollingGraphUpdaterParameters {
String url();

boolean blockReadinessUntilInitialized();

boolean fuzzyTripMatching();
}
}
Original file line number Diff line number Diff line change
@@ -2,8 +2,6 @@

import java.time.Duration;
import org.opentripplanner.updater.spi.HttpHeaders;
import org.opentripplanner.updater.spi.PollingGraphUpdaterParameters;
import org.opentripplanner.updater.trip.UrlUpdaterParameters;

public record SiriETUpdaterParameters(
String configRef,
@@ -18,8 +16,7 @@ public record SiriETUpdaterParameters(
HttpHeaders httpRequestHeaders,
boolean producerMetrics
)
implements
PollingGraphUpdaterParameters, UrlUpdaterParameters, SiriETHttpTripUpdateSource.Parameters {
implements SiriETUpdater.Parameters, SiriETHttpTripUpdateSource.Parameters {
public SiriETHttpTripUpdateSource.Parameters sourceParameters() {
return this;
}
Original file line number Diff line number Diff line change
@@ -11,7 +11,8 @@
import uk.org.siri.siri20.Siri;

/**
* Load real-time updates from SIRI-SX and SIRI-ET feeds over HTTP.
* Load real-time updates from SIRI-SX and SIRI-ET feeds over HTTP using the request/response
* flow, which asks the server to only send the latest updates for a given requestor ref.
*/
public class SiriHttpLoader implements SiriLoader {

Loading