@@ -81,16 +81,24 @@ public static FeedLoadResult load (String filePath, DataSource dataSource) {
81
81
* 1. The tables' id column has been modified to be auto-incrementing.
82
82
* 2. Primary keys may be added to certain columns/tables.
83
83
* 3. Additional editor-specific columns are added to certain tables.
84
- * @param feedId feed ID (schema namespace) to copy from
85
- * @param dataSource JDBC connection to existing database
86
- * @return FIXME should this be a separate SnapshotResult object?
84
+ * @param feedId feed ID (schema namespace) to copy from
85
+ * @param dataSource JDBC connection to existing database
86
+ * @param normalizeStopTimes whether to normalize stop sequence values on snapshot
87
+ * @return the result of the snapshot
87
88
*/
88
- public static SnapshotResult makeSnapshot (String feedId , DataSource dataSource ) {
89
- JdbcGtfsSnapshotter snapshotter = new JdbcGtfsSnapshotter (feedId , dataSource );
89
+ public static SnapshotResult makeSnapshot (String feedId , DataSource dataSource , boolean normalizeStopTimes ) {
90
+ JdbcGtfsSnapshotter snapshotter = new JdbcGtfsSnapshotter (feedId , dataSource , normalizeStopTimes );
90
91
SnapshotResult result = snapshotter .copyTables ();
91
92
return result ;
92
93
}
93
94
95
+ /**
96
+ * Overloaded makeSnapshot method that defaults to normalize stop times.
97
+ */
98
+ public static SnapshotResult makeSnapshot (String feedId , DataSource dataSource ) {
99
+ return makeSnapshot (feedId , dataSource , true );
100
+ }
101
+
94
102
/**
95
103
* Once a feed has been loaded into the database, examine its contents looking for various problems and errors.
96
104
*/
@@ -277,7 +285,7 @@ public static void main (String[] args) throws IOException {
277
285
}
278
286
if (namespaceToSnapshot != null ) {
279
287
LOG .info ("Snapshotting feed with unique identifier {}" , namespaceToSnapshot );
280
- FeedLoadResult snapshotResult = makeSnapshot (namespaceToSnapshot , dataSource );
288
+ FeedLoadResult snapshotResult = makeSnapshot (namespaceToSnapshot , dataSource , false );
281
289
if (storeResults ) {
282
290
File snapshotResultFile = new File (directory , String .format ("%s-snapshot.json" , snapshotResult .uniqueIdentifier ));
283
291
LOG .info ("Storing validation result at {}" , snapshotResultFile .getAbsolutePath ());
0 commit comments