Commit 543a0ef9 authored by Bergamote Orange's avatar Bergamote Orange
Browse files

remaining details from MR comments

parent 301372c7
......@@ -30,8 +30,7 @@ public class BatchConstants {
public static final String SQL_SELECT_BY_LTID_IN_SINGLEPLACECLUSTERPERIOD = "select * from " + SINGLE_PLACE_CLUSTER_PERIOD_TABLE + " WHERE ltid= ?";
public static final String SQL_SELECT_DISTINCT_LTID_FROM_EXPOSEDVISITS = "select distinct " + LTID_COL + " from " + EXPOSED_VISITS_TABLE + " order by " + LTID_COL;
public static final String SQL_SELECT_DISTINCT_FROM_CLUSTERPERIODS_ORDERBY_LTID = "select distinct " + LTID_COL + " from " + SINGLE_PLACE_CLUSTER_PERIOD_TABLE + " ORDER BY " + LTID_COL;
public static final String SQL_SELECT_FROM_EXPOSEDVISITS_WHERE_LTID_ORDERBY_PERIOD_AND_TIMESLOT = "select * from " + EXPOSED_VISITS_TABLE
+ " WHERE ltid= ? ORDER BY " + PERIOD_COLUMN + ", " + TIMESLOT_COLUMN;
public static final String SQL_SELECT_FROM_EXPOSEDVISITS_WHERE_LTID_ORDERBY_PERIOD_AND_TIMESLOT = "select * from " + EXPOSED_VISITS_TABLE + " WHERE ltid= ? ORDER BY " + PERIOD_COLUMN + ", " + TIMESLOT_COLUMN;
public static final String SQL_TRUNCATE_TABLE_CLUSTERPERIODS = "truncate table " + SINGLE_PLACE_CLUSTER_PERIOD_TABLE + ";";
}
......@@ -41,9 +41,6 @@ public class IndexationStepBatchConfig {
@Autowired
private BatchProperties properties;
@Autowired
private DataSource dataSource;
@Autowired
private ClusterPeriodModelsMapper mapper;
......@@ -81,7 +78,7 @@ public class IndexationStepBatchConfig {
return stepBuilderFactory.get("partitionedClustersIndexation")
.<Map.Entry<String, List<String>>, ClusterFile>chunk(properties.getIndexationStepChunkSize())
.reader(memoryMapItemReader(null, null))
.processor(singlePlaceClusterBuilder(jdbcTemplate)) // build a Map of ClusterFile at once
.processor(singlePlaceClusterBuilder()) // build a Map of ClusterFile at once
.writer(indexationWriter(objectMapper)) // build Files and index
.build();
}
......@@ -96,7 +93,7 @@ public class IndexationStepBatchConfig {
}
@Bean
public ItemProcessor<Map.Entry<String, List<String>>, ClusterFile> singlePlaceClusterBuilder(final JdbcTemplate jdbcTemplate) {
public ItemProcessor<Map.Entry<String, List<String>>, ClusterFile> singlePlaceClusterBuilder() {
return new SinglePlaceClusterBuilder(jdbcTemplate, mapper);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment