Skip to content

Commit 293217e

Browse files
committed
Apply consistent code style in JobConfig.
1 parent 158f59d commit 293217e

File tree

1 file changed

+96
-95
lines changed

1 file changed

+96
-95
lines changed

src/main/java/fi/hsl/jore/importer/config/jobs/JobConfig.java

Lines changed: 96 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ public class JobConfig extends BatchConfig {
101101

102102
public static final String JOB_NAME = "importJoreJob";
103103

104+
/* Steps to import data from Jore 3 to importer staging DB. */
104105
@Bean
105-
public Job importJob(/* Steps to import data from Jore 3 to importer staging DB. */
106-
final Flow importNodesFlow,
106+
public Job importJob(final Flow importNodesFlow,
107107
final Flow importLinksFlow,
108108
final Flow importLinkPointsFlow,
109109
final Flow importLinesFlow,
@@ -112,21 +112,21 @@ public Job importJob(/* Steps to import data from Jore 3 to importer staging DB.
112112
final Flow importRouteDirectionsFlow,
113113
final Flow importRouteLinksFlow,
114114
final Flow importScheduledStopPointsFlow,
115-
/* Export data from the importer staging DB to Jore 4 DB. */
115+
// Export data from the importer staging DB to Jore 4 DB.
116116
final Flow jore4ExportFlow) {
117117
return jobs.get(JOB_NAME)
118-
.start(importNodesFlow)
119-
.next(importLinksFlow)
120-
.next(importLinkPointsFlow)
121-
.next(importLinesFlow)
122-
.next(importLineHeadersFlow)
123-
.next(importRoutesFlow)
124-
.next(importRouteDirectionsFlow)
125-
.next(importRouteLinksFlow)
126-
.next(importScheduledStopPointsFlow)
127-
.next(jore4ExportFlow)
128-
.end()
129-
.build();
118+
.start(importNodesFlow)
119+
.next(importLinksFlow)
120+
.next(importLinkPointsFlow)
121+
.next(importLinesFlow)
122+
.next(importLineHeadersFlow)
123+
.next(importRoutesFlow)
124+
.next(importRouteDirectionsFlow)
125+
.next(importRouteLinksFlow)
126+
.next(importScheduledStopPointsFlow)
127+
.next(jore4ExportFlow)
128+
.end()
129+
.build();
130130
}
131131

132132
@Bean
@@ -153,6 +153,7 @@ public Step prepareNodesStep(final INodeImportRepository nodeImportRepository) {
153153
public Step importNodesStep(final NodeReader nodeReader,
154154
final INodeImportRepository nodeImportRepository) {
155155
final int chunkSize = 1000;
156+
156157
return steps.get("importNodesStep")
157158
.allowStartIfComplete(true)
158159
.<JrNode, Jore3Node>chunk(chunkSize)
@@ -318,14 +319,14 @@ public Step importLineHeadersStep(final LineHeaderReader lineHeaderReader,
318319
final ILineHeaderImportRepository lineHeaderImportRepository) {
319320
final int chunkSize = 1;
320321
return steps.get("importLineHeadersStep")
321-
.allowStartIfComplete(true)
322-
.<JrLineHeader, Jore3LineHeader>chunk(chunkSize)
323-
.reader(lineHeaderReader.build())
324-
.processor(new LineHeaderProcessor())
325-
.writer(new GenericImportWriter<>(lineHeaderImportRepository))
326-
.faultTolerant()
327-
.skipPolicy(new AlwaysSkipItemSkipPolicy())
328-
.build();
322+
.allowStartIfComplete(true)
323+
.<JrLineHeader, Jore3LineHeader>chunk(chunkSize)
324+
.reader(lineHeaderReader.build())
325+
.processor(new LineHeaderProcessor())
326+
.writer(new GenericImportWriter<>(lineHeaderImportRepository))
327+
.faultTolerant()
328+
.skipPolicy(new AlwaysSkipItemSkipPolicy())
329+
.build();
329330
}
330331

331332
@Bean
@@ -499,9 +500,9 @@ public Step commitRouteStopPointsStep(final IRouteStopPointImportRepository rout
499500
@Bean
500501
public Step commitRouteLinksStep(final IRouteLinkImportRepository routeLinkImportRepository) {
501502
return steps.get("commitRouteLinksStep")
502-
.allowStartIfComplete(true)
503-
.tasklet(new GenericCommitTasklet<>(routeLinkImportRepository))
504-
.build();
503+
.allowStartIfComplete(true)
504+
.tasklet(new GenericCommitTasklet<>(routeLinkImportRepository))
505+
.build();
505506
}
506507

507508
@Bean
@@ -518,29 +519,29 @@ public Flow importScheduledStopPointsFlow(final Step prepareScheduledStopPointsS
518519
@Bean
519520
public Step prepareScheduledStopPointsStep(final IScheduledStopPointImportRepository repository) {
520521
return steps.get("prepareScheduledStopPointsStep")
521-
.allowStartIfComplete(true)
522-
.tasklet(new GenericCleanupTasklet<>(repository))
523-
.build();
522+
.allowStartIfComplete(true)
523+
.tasklet(new GenericCleanupTasklet<>(repository))
524+
.build();
524525
}
525526

526527
@Bean
527528
public Step importScheduledStopPointsStep(final ScheduledStopPointImportReader reader,
528529
final IScheduledStopPointImportRepository repository) {
529530
return steps.get("importScheduledStopPointsStep")
530-
.allowStartIfComplete(true)
531-
.<JrScheduledStopPoint, Jore3ScheduledStopPoint>chunk(1000)
532-
.reader(reader.build())
533-
.processor(new ScheduledStopPointImportProcessor())
534-
.writer(new GenericImportWriter<>(repository))
535-
.build();
531+
.allowStartIfComplete(true)
532+
.<JrScheduledStopPoint, Jore3ScheduledStopPoint>chunk(1000)
533+
.reader(reader.build())
534+
.processor(new ScheduledStopPointImportProcessor())
535+
.writer(new GenericImportWriter<>(repository))
536+
.build();
536537
}
537538

538539
@Bean
539540
public Step commitScheduledStopPointsStep(final IScheduledStopPointImportRepository repository) {
540541
return steps.get("commitScheduledStopPointsStep")
541-
.allowStartIfComplete(true)
542-
.tasklet(new GenericCommitTasklet<>(repository))
543-
.build();
542+
.allowStartIfComplete(true)
543+
.tasklet(new GenericCommitTasklet<>(repository))
544+
.build();
544545
}
545546

546547
@Bean
@@ -565,104 +566,104 @@ public Flow jore4ExportFlow(final Step prepareJore4ExportStep,
565566
@Bean
566567
public Step prepareJore4ExportStep(final Jore4SchemaCleanupTasklet cleanupTasklet) {
567568
return steps.get("prepareJore4ExportStep")
568-
.allowStartIfComplete(true)
569-
.tasklet(cleanupTasklet)
570-
.build();
569+
.allowStartIfComplete(true)
570+
.tasklet(cleanupTasklet)
571+
.build();
571572
}
572573

573574
@Bean
574575
public Step exportScheduledStopPointsStep(final ScheduledStopPointExportReader reader,
575576
final ScheduledStopPointExportProcessor processor,
576577
final ScheduledStopPointExportWriter writer) {
577578
return steps.get("exportScheduledStopPointsStep")
578-
.allowStartIfComplete(true)
579-
.<ImporterScheduledStopPoint, Jore4ScheduledStopPoint>chunk(1)
580-
.reader(reader.build())
581-
.processor(processor)
582-
.writer(writer)
583-
.faultTolerant()
584-
.skipPolicy(new AlwaysSkipItemSkipPolicy())
585-
.listener(new StatisticsLoggingStepExecutionListener())
586-
.build();
579+
.allowStartIfComplete(true)
580+
.<ImporterScheduledStopPoint, Jore4ScheduledStopPoint>chunk(1)
581+
.reader(reader.build())
582+
.processor(processor)
583+
.writer(writer)
584+
.faultTolerant()
585+
.skipPolicy(new AlwaysSkipItemSkipPolicy())
586+
.listener(new StatisticsLoggingStepExecutionListener())
587+
.build();
587588
}
588589

589590
@Bean
590591
public Step exportLinesStep(final LineExportReader reader,
591592
final LineExportProcessor processor,
592593
final LineExportWriter writer) {
593594
return steps.get("exportLinesStep")
594-
.allowStartIfComplete(true)
595-
.<ImporterLine, Jore4Line>chunk(1)
596-
.reader(reader.build())
597-
.processor(processor)
598-
.writer(writer)
599-
.faultTolerant()
600-
.skipPolicy(new AlwaysSkipItemSkipPolicy())
601-
.listener(new StatisticsLoggingStepExecutionListener())
602-
.build();
595+
.allowStartIfComplete(true)
596+
.<ImporterLine, Jore4Line>chunk(1)
597+
.reader(reader.build())
598+
.processor(processor)
599+
.writer(writer)
600+
.faultTolerant()
601+
.skipPolicy(new AlwaysSkipItemSkipPolicy())
602+
.listener(new StatisticsLoggingStepExecutionListener())
603+
.build();
603604
}
604605

605606
@Bean
606607
public Step exportRoutesStep(final RouteExportReader reader,
607608
final RouteExportProcessor processor,
608609
final RouteExportWriter writer) {
609610
return steps.get("exportRoutesStep")
610-
.allowStartIfComplete(true)
611-
.<ImporterRoute, Jore4Route>chunk(1)
612-
.reader(reader.build())
613-
.processor(processor)
614-
.writer(writer)
615-
.faultTolerant()
616-
.skipPolicy(new AlwaysSkipItemSkipPolicy())
617-
.listener(new StatisticsLoggingStepExecutionListener())
618-
.build();
611+
.allowStartIfComplete(true)
612+
.<ImporterRoute, Jore4Route>chunk(1)
613+
.reader(reader.build())
614+
.processor(processor)
615+
.writer(writer)
616+
.faultTolerant()
617+
.skipPolicy(new AlwaysSkipItemSkipPolicy())
618+
.listener(new StatisticsLoggingStepExecutionListener())
619+
.build();
619620
}
620621

621622
@Bean
622623
public Step exportRouteGeometriesStep(final RouteGeometryExportReader reader,
623624
final MapMatchingProcessor processor,
624625
final RouteGeometryExportWriter writer) {
625626
return steps.get("exportRouteGeometriesStep")
626-
.allowStartIfComplete(true)
627-
.<ImporterRouteGeometry, Jore4RouteGeometry>chunk(1)
628-
.reader(reader.build())
629-
.processor(processor)
630-
.writer(writer)
631-
.faultTolerant()
632-
.skipPolicy(new AlwaysSkipItemSkipPolicy())
633-
.listener(new StatisticsLoggingStepExecutionListener())
634-
.build();
627+
.allowStartIfComplete(true)
628+
.<ImporterRouteGeometry, Jore4RouteGeometry>chunk(1)
629+
.reader(reader.build())
630+
.processor(processor)
631+
.writer(writer)
632+
.faultTolerant()
633+
.skipPolicy(new AlwaysSkipItemSkipPolicy())
634+
.listener(new StatisticsLoggingStepExecutionListener())
635+
.build();
635636
}
636637

637638
@Bean
638639
public Step exportJourneyPatternsStep(final JourneyPatternExportReader reader,
639640
final JourneyPatternExportProcessor processor,
640641
final JourneyPatternExportWriter writer) {
641642
return steps.get("exportJourneyPatternsStep")
642-
.allowStartIfComplete(true)
643-
.<ImporterJourneyPattern, Jore4JourneyPattern>chunk(1)
644-
.reader(reader.build())
645-
.processor(processor)
646-
.writer(writer)
647-
.faultTolerant()
648-
.skipPolicy(new AlwaysSkipItemSkipPolicy())
649-
.listener(new StatisticsLoggingStepExecutionListener())
650-
.build();
643+
.allowStartIfComplete(true)
644+
.<ImporterJourneyPattern, Jore4JourneyPattern>chunk(1)
645+
.reader(reader.build())
646+
.processor(processor)
647+
.writer(writer)
648+
.faultTolerant()
649+
.skipPolicy(new AlwaysSkipItemSkipPolicy())
650+
.listener(new StatisticsLoggingStepExecutionListener())
651+
.build();
651652
}
652653

653654
@Bean
654655
public Step exportJourneyPatternStopsStep(final JourneyPatternStopExportReader reader,
655656
final JourneyPatternStopExportProcessor processor,
656657
final JourneyPatternStopExportWriter writer) {
657658
return steps.get("exportJourneyPatternStopsStep")
658-
.allowStartIfComplete(true)
659-
.<ImporterJourneyPatternStop, Jore4JourneyPatternStop>chunk(1000)
660-
.reader(reader.build())
661-
.processor(processor)
662-
.writer(writer)
663-
.faultTolerant()
664-
.skipPolicy(new AlwaysSkipItemSkipPolicy())
665-
.listener(new StatisticsLoggingStepExecutionListener())
666-
.build();
659+
.allowStartIfComplete(true)
660+
.<ImporterJourneyPatternStop, Jore4JourneyPatternStop>chunk(1000)
661+
.reader(reader.build())
662+
.processor(processor)
663+
.writer(writer)
664+
.faultTolerant()
665+
.skipPolicy(new AlwaysSkipItemSkipPolicy())
666+
.listener(new StatisticsLoggingStepExecutionListener())
667+
.build();
667668
}
668669
}

0 commit comments

Comments
 (0)