Skip to content

Commit 34c698c

Browse files
committed
chore(core): use parallel stream to speed up loading of data
1 parent fb2361f commit 34c698c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/src/main/java/com/github/spring/esdata/loader/core/SpringEsDataLoader.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public void load(final IndexData d) {
6161
new InputStreamReader(d.gzipped ? new GZIPInputStream(is) : is, StandardCharsets.UTF_8))) {
6262

6363
List<IndexQuery> indexQueries = br.lines()// each line represent a document to be indexed
64+
.parallel()// let's speed things up a lil'bit :)
6465
.peek((l) -> LOGGER.debug("Preparing IndexQuery for line: '{}'", l))//
6566
.map(line -> SpringEsDataLoader.getIndexQuery(line, esEntityInfo.getIndexName(), esEntityInfo.getIndexType()))//
6667
.skip(d.nbSkipItems)//

0 commit comments

Comments
 (0)