File tree 3 files changed +7
-1
lines changed
java/fi/hsl/transitdata/pulsarpubtransconnect
3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -24,12 +24,14 @@ public abstract class PubtransTableHandler {
24
24
final TransitdataProperties .ProtobufSchema schema ;
25
25
private Jedis jedis ;
26
26
private final String timeZone ;
27
+ private final boolean excludeMetroTrips ;
27
28
28
29
public PubtransTableHandler (PulsarApplicationContext context , TransitdataProperties .ProtobufSchema handlerSchema ) {
29
30
lastModifiedTimeStamp = (System .currentTimeMillis () - 5000 );
30
31
jedis = context .getJedis ();
31
32
producer = context .getSingleProducer ();
32
33
timeZone = context .getConfig ().getString ("pubtrans.timezone" );
34
+ excludeMetroTrips = context .getConfig ().getBoolean ("pubtrans.excludeMetroTrips" );
33
35
schema = handlerSchema ;
34
36
}
35
37
@@ -94,7 +96,7 @@ public Collection<TypedMessageBuilder<byte[]>> handleResultSet(ResultSet resultS
94
96
} else {
95
97
PubtransTableProtos .DOITripInfo tripInfo = maybeTripInfo .get ();
96
98
97
- if (tripInfo .getRouteId ().startsWith ("31M" )) {
99
+ if (excludeMetroTrips && tripInfo .getRouteId ().startsWith ("31M" )) {
98
100
metroTripCount ++;
99
101
metroRouteIds .add (tripInfo .getRouteId ());
100
102
} else {
Original file line number Diff line number Diff line change @@ -37,4 +37,6 @@ application {
37
37
enableCacheTimestampCheck=${?ENABLE_CACHE_TIMESTAMP_CHECK}
38
38
cacheMaxAgeInMinutes=180
39
39
cacheMaxAgeInMinutes=${?CACHE_MAX_AGE_IN_MINS}
40
+ excludeMetroTrips=true
41
+ excludeMetroTrips=${?EXCLUDE_METRO_TRIPS}
40
42
}
Original file line number Diff line number Diff line change @@ -37,4 +37,6 @@ application {
37
37
enableCacheTimestampCheck=${?ENABLE_CACHE_TIMESTAMP_CHECK}
38
38
cacheMaxAgeInMinutes=180
39
39
cacheMaxAgeInMinutes=${?CACHE_MAX_AGE_IN_MINS}
40
+ excludeMetroTrips=true
41
+ excludeMetroTrips=${?EXCLUDE_METRO_TRIPS}
40
42
}
You can’t perform that action at this time.
0 commit comments